INSActivityIndicatorView was written by Dawid Płatek for inspace.io
INSActivityIndicatorView is a customizable and lightweight implementation of activity indicator view for iOS.
- Customizable line width ✅
- Customizable timing function ✅
- Customizable animation duration ✅
- Custom colors support ✅
- Customizable using Interface Builder ✅
Basically, you should need to create an object representing indicator, add it to parent view, define the size/position and invoke startAnimating
method.
let indicatorView = INSActivityIndicatorView()
indicatorView.frame.size = CGSize(width: 60, height: 60)
indicatorView.center = view.center
view.addSubview(indicatorView)
indicatorView.startAnimating()
You can customize the behaviour and style of INSActivityIndicatorView. All customization is handled by the properties listed below. If you need any further customization you can even subclass the main class.
The width of the indicator borderline. It can be changed using Interface Builder.
Default: 3.0
The duration of the single, full cycle of rotation animation. It can be changed using Interface Builder.
Default: 1.0
The timing fucation used by internal CABasicAnimation
instance. It cannot be changed using Interface Builder.
Default: CAMediaTimingFunction(name: .linear)
The color of foreground layer. It can be changed using Interface Builder.
Default: UIColor.black
The color of background layer. It can be changed using Interface Builder.
Default: UIColor.black.withAlphaComponent(0.3)
INSActivityIndicatorView will be compatible with the lastest public release of Swift.
INSActivityIndicatorView is available through CocoaPods. To install it, add the following to your Podfile
:
pod 'INSActivityIndicatorView'
- iOS 8.0+
- Xcode 8.0+
INSActivityIndicatorView is released under the MIT license. See LICENSE for details.