SkillAgentSearch skills...

DRSubmitButton

A custom submit button with normal, loading, success and warning state.

Install / Use

/learn @citysite102/DRSubmitButton
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

DRSubmitButton

A custom submit button with normal, loading, success and warning state.

CI Status Version License Platform

<img src="Readme/DRSubmitButton.gif">

This is original inspired from a work on Pinterest, written in Swift with full implementation of animations.

Installation

Cocoapods

Install Cocoapods if need be

$ gem install cocoapods

Add NVActivityIndicatorView in your Podfile

use_frameworks!

pod 'DRSubmitButton'

Then, run the following command

$ pod install

Manual

Copy DRSubmitButton.swift to your project. That's it.

Usage

Firstly, import DRSubmitButton

import DRSubmitButton

Initialization

Initialize your button with simple line of init method:

submitButton.init(frame: CGRectMake(0, 0, 160, 60))

Implement your button with the usual addTarget method:

submitButtonDemo.addTarget(self, action: #selector(ViewController.demoFunction))

Button State

The action will be triggered only during the .normal state. You can simply change the button state to loading state by:

submitButtonDemo.buttonState = .loading

success state by:

submitButtonDemo.buttonState = .success

Customize

The icon images are fully customizable including:

  1. Submit Icon
  2. Success Icon
  3. Warning Icon
submitButtonDemo.submitImage = UIImage(named: "icon_submit");

The color themes are fully customizable including:

  1. All Icon's Color
  2. All Background Color
submitButtonDemo.submitIconColor = UIColor(red: 6/255, green: 164/255, blue: 191/255, alpha: 1.0)
submitButtonDemo.normalBackgrounColor = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)

License

The MIT License (MIT)

Copyright (c) 2016 Samuel Kao

View on GitHub
GitHub Stars17
CategoryDevelopment
Updated1y ago
Forks3

Languages

Swift

Security Score

75/100

Audited on Jun 12, 2024

No findings