BPBlockActivityIndicator
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.
Install / Use
/learn @ppth0608/BPBlockActivityIndicatorREADME
BPBlockActivityIndicator
BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iOS. </br>
Demo
<img src="https://user-images.githubusercontent.com/9531750/28249005-0ff9b0b4-6a89-11e7-906a-d00e2ffdf7fa.gif" width="320" height="590" />Requirements
- Deployment Target -
iOS 8.0 - Swift Version -
Swift 3.2
Installation
CocoaPods
BPBlockActivityIndicator is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BPBlockActivityIndicator"
Carthage
Simply add the following line to your Cartfile:
github "ppth0608/BPBlockActivityIndicator"
Manual
Copy the folder Source/ to your project
Usage
Using BPBlockActivityIndicator isn't difficult at all. There are two actual ways of implementing it in your project:
- Storyboard setup
- Manual setup
Storyboard Setup
First, add a UIView to your Storyboard and set the custom class (You can set custom classes in Identity Inspector) as it shown in the picture below:
<img width="813" alt="2017-07-17 12 51 06" src="https://user-images.githubusercontent.com/9531750/28249057-172a6648-6a8a-11e7-9f7d-4ec226279fe0.png" width="1000" height="650" />Then, add the corresponding Outlet in to your code:
@IBOutlet weak var blockIndicator: BPBlockActivityIndicator!
Manual setup
If you would like to setup BPBlockActivityIndicator manually, you have to do the following:
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)
}
Animate & Stop
You can easily animate and stop animations like so:
@IBAction func startAnimate(_ sender: Any) {
blockIndicator.animate()
}
@IBAction func stopAnimate(_ sender: Any) {
blockIndicator.stop()
}
Customize
If you want to setup animation speed or the color of blocks (if using a storyboard) you can set the properties in the Identity Inspector as it shown in the picture below:
<img width="359" alt="2017-07-17 12 51 51" src="https://user-images.githubusercontent.com/9531750/28249065-2bb96d48-6a8a-11e7-9cb0-c3af02447c5f.png">Or (if using code), you can call methods as 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 settings are shown below:
- Animation Speed : 0.6
- Color of blocks : Blue
Author
Ben.Park, ppth0608@naver.com
Designed By
Suna.Shin, tjsdk2309@gmail.com
Contribute
Always welcome :) Please submit pull request to BPBlockActivityIndicator.
License
BPBlockActivityIndicator is available under the MIT license. See the LICENSE file for more info.
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
