Custom UIButton component with some interesting animations written in Swift.
Add pod 'JPButton'
to your Podfile.
Copy files from Classes
folder into your project. Set the UIButton class in Nib to JPButton
or create it programmatically.
Open the demo project to check all available options.
All properties can be set from Interface Builder or from code- To enable the breathing animation, set
breathingEnabled
property totrue
. - Customize animation duration by changing
breathDuration
property.
- To start the border runner animation, just call
startBorderRunner
method. Runner color, shape and size can be customized by changing parameters of thestartBorderRunner
method. - To stop the animation, call the
stopAndRemoveBorderRunner
method.
You can combine breathing animation with the border runner animation by setting the breathingEnabled
property to true
and calling the startBorderRunner
method.
Josip Petric, josip.petric1@gmail.com
JPButton is available under the MIT license. See the LICENSE file for more info.