🧤Easily manage state values with UIButton with UIActivityIndicatorView (UIButtons include simple animation)
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 12+
- Swift 5
IndicatorButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'IndicatorButton'
add a 'UIButton' to your Storyboard and set class, module.
let indicatorButton = IndicatorButton(frame: , text: )
indicatorButton.type = .shake // case normal, pulse, shake, flash
- Basic
// Start
indicatorButton.startAnimating()
// Stop
indicatorButton.stopAnimating()
- callbackable
indicatorButton.startAnimating {
//
}
indicatorButton.stopAnimating {
//
}
indicatorButton.isSelected = !indicatorButton.isSelected
titleColor: UIColor
defines the UIButton titleLabel text color. (default is .black)
selectedTitleColor: UIColor
(default is .white)
bgColor: UIColor
defines the UIButton layer backgroundColor. (default is .white)
selectedBgColor: UIColor
(default is .black)
borderColor: UIColor
defines the UIButton layer border color. (default is .clear)
selectedBorderColor: UIColor
(default is .clear)
borderWidth: CGFloat
defines the UIButton layer border width. (default is '1.0')
cornerRadius: CGFloat
defines the UIButton layer corder radius. (default is '8.0')
withShadow: Bool
defines the UIButton shadow apply. (default is 'true')
shadowColor: UIColor
defines the UIButton shadow color. (default is .black)
indicatorColor: UIColor
defines the UIActivityIndicatorView color. (default is .gray)
selectedIndicatorColor: UIColor
(default is .gray)
gwangyonglee, gwangyonglee92@gmail.com
IndicatorButton is available under the MIT license. See the LICENSE file for more info.