Dots
Dots is the replacement of UIActivityIndicatorView. It provides modern and highly customizable loading indicator. You can call this dots loading view from everywhere in your program with just 2 lines of code.
This is a for of makomoris "Dots" with enhanced interface and functionality. Major differences:
- If you add the DotsLoadingView as a subview it will show only on that view, otherwise - as before - on the whole screen
- A variable number of dots, defined by the number of colors provided, will be displayed
- There is support for a label being shown in a box below the dots. It can be updated while showing the indicator
GIFs
Google color
Pink gradient
Twitter color
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
iOS 10.0 +
Installation
Download the source code and add it to your project.With cocoa pods add this to your podfile:
pod 'Dots', :git =>'https://github.com/Oggerschummer/Dots.git
Usage
In your ViewController, run below.
Show
let loadingView = DotsLoadingView(colors: nil)
self.view.addSubview(loadingView)
Hide
loadingView.stop()
Customization
You can use custom dot colors.
Note: You need to create array which includes four UIColors. The number of colors defines the size of the dots, susing more than six I would not recommend
let dotColors = [UIColor.red, UIColor.blue, UIColor.green, UIColor.yellow]
let loadingView = DotsLoadingView(colors: dotColors)
self.view.addSubview(loadingView)
Author
makomori, makomori26@gmail.com
License
Dots is available under the MIT license. See the LICENSE file for more info.