Giter Site home page Giter Site logo

mohsinalimat / drsubmitbutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from citysite102/drsubmitbutton

1.0 3.0 0.0 1.82 MB

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

License: MIT License

Ruby 3.80% Swift 74.57% Objective-C 1.38% Shell 20.24%

drsubmitbutton's Introduction

DRSubmitButton

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

CI Status Version License Platform

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

drsubmitbutton's People

Contributors

citysite102 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.