https://github.com/ppth0608/BPBlockActivityIndicator
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.
https://github.com/ppth0608/BPBlockActivityIndicator
activityindicator animation loadingview storyboard ui
Last synced: 4 months ago
JSON representation
A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.
- Host: GitHub
- URL: https://github.com/ppth0608/BPBlockActivityIndicator
- Owner: ppth0608
- License: mit
- Created: 2017-07-09T13:45:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-14T05:18:26.000Z (over 8 years ago)
- Last Synced: 2024-04-24T14:46:29.724Z (over 1 year ago)
- Topics: activityindicator, animation, loadingview, storyboard, ui
- Language: Swift
- Homepage:
- Size: 28.3 KB
- Stars: 44
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - BPBlockActivityIndicator - A simple and awesome Loading Activity Indicator(with funny block animation) for your iOS app. (UI / Activity Indicator)
- awesome-ios-star - BPBlockActivityIndicator - A simple and awesome Loading Activity Indicator(with funny block animation) for your iOS app. (UI / Activity Indicator)
- fucking-awesome-ios - BPBlockActivityIndicator - A simple and awesome Loading Activity Indicator(with funny block animation) for your iOS app. (UI / Activity Indicator)
README
# BPBlockActivityIndicator
**BPBlockActivityIndicator** is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iOS.
## Demo

## Requirements
- Deployment Target - `iOS 8.0`
- Swift Version - `Swift 3.2`
## Installation
### CocoaPods
BPBlockActivityIndicator is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "BPBlockActivityIndicator"
```
### Carthage
Simply add the following line to your Cartfile:
``` ruby
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:

Then, add the corresponding Outlet in to your code:
```Swift
@IBOutlet weak var blockIndicator: BPBlockActivityIndicator!
```
### Manual setup
If you would like to setup **BPBlockActivityIndicator** manually, you have to do the following:
```Swift
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:
```Swift
@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:

Or (if using code), you can call methods as shown in the code below:
```Swift
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.