Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 867 Bytes

File metadata and controls

35 lines (27 loc) · 867 Bytes

StateButton

Subclass UIButton with different states

StateButton

How to use

var stateButton : StateButton!
stateButton.titles = ["facebook"]
stateButton.images = [UIImage(named: "icon_login_facebook")!, UIImage(named: "icon_login_twitter")!, UIImage(named: "icon_login_mail")!]
stateButton.titleColors = [UIColor.redColor(), UIColor.greenColor(), UIColor.blueColor()]
stateButton.closures = ([ { (index) -> () in
        println("State \(index)")
    },  
    { (index) -> () in
        println("State \(index)")
    },
    { (index) -> () in
        println("State \(index)")
    }])
stateButton.transitions = [(kCATransitionPush, kCATransitionFromTop), (kCATransitionMoveIn, kCATransitionFromLeft), (kCATransitionReveal, kCATransitionFromRight)]

Installation

Use cocoapods

pod 'StateButton'

License

MIT