TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Aug 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✓ |
Maintained by BPStatusBarAlert.
BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iOS.
iOS 8.0
Swift 3.2
Copy the folder Source/
to your project
Using BPBlockActivityIndicator isn’t difficult at all. There are two actual ways of implementing it in your project:
First, you’re about to add 1 UIViews to your Storyboard and setup custom classes (You can set custom classes in Identity Inspector) as it shown in the picture below
and, add Outlet in to your code
@IBOutlet weak var blockIndicator: BPBlockActivityIndicator!
if for some reason you’d like to setup BPBlockActivityIndicator manually you have to do the following step
var blockIndicatorindicator: BPBlockActivityIndicator!
override func viewDidLoad() {
super.viewDidLoad()
// initialize BPBlockActivityIndicator programmatically
blockIndicatorindicator = BPBlockActivityIndicator(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
view.addSubview(blockIndicatorindicator)
}
You can easily animate and stop animation
@IBAction func startAnimate(_ sender: Any) {
blockIndicator.animate()
}
@IBAction func stopAnimate(_ sender: Any) {
blockIndicator.stop()
}
if you want to setup animation speed or color of blocks(if using storyboard) you can set property in Identity Inspector as it shown in the picture below
or (if using code) , you can call methods as it shown in the code below
blockIndicatorindicator = BPBlockActivityIndicator(frame: CGRect(x: 30, y: 30, width: 40, height: 40))
.movementSpeed(0.2)
.blockColor(.cyan)
view.addSubview(blockIndicatorindicator)
Default setting is shown in below
Ben.Park, [email protected]
Suna.Shin, [email protected]
always welcome :) please, pull request for BPBlockActivityIndicator
BPBlockActivityIndicator is available under the MIT license. See the LICENSE file for more info.