#JMButtonLoader
JMButtonLoader is an UI Element. It's a Button that when is pressed, show an animation while action is loading.
Drag and copy JMButtonLoader file into your project
Coming soon
Coming soon
##Usage ####Without UIStoryboard
-
Define
JMButtonLoader
:var buttonLoader : JMButtonLoader!
-
Create button from constructor:
init(frame: CGRect)
-
Just need
addSubview
:view.addSubview(buttonLoader)
####With UIStoryboard
-
Add UIButton in
ViewController
or Subclass orUIView
. -
Change class in
Identity Inspector
:UIbutton -->
JMButtonLoader
-
Just need add
@IBOutlet weak var buttonLoader: JMButtonLoader!
inViewController
orUIView
Storyboard class.
##Atributtes
- @IBInspectable var lineColor : UIColor = UIColor.clearColor()
- @IBInspectable var startWithBorder : Bool = false -->
This attribute is for init button with border or without this.
- @IBInspectable var borderWidth : CGFloat = 1
- @IBInspectable var textLoading : String = "Loading..."
##Delegate
buttonLoader.delegate = self
func buttonTapped()
is called when Button is pressed. When is pressed the button start the animation and change the text.- For pause the animation and stop the button, call
buttonLoader.stopButton()
and execute your callback action.
JMButtonLoader is available under the MIT license.