PKLoader
A Swift based helper class that will provide the loader for your application, on a view or on the window.
Requirements
- iOS 10.0+
- Xcode 9.4
Installation
For manual instalation, drag Source folder into your project.
or use CocoaPod adding this line to you Podfile:
pod 'PKLoader'Usage
For Start Loading
- Just call
startAnimating()method withsharedinstance ofPKLoader
Example:
//If you want to show the loader on window/full screen, Use:
PKLoader.shared.startAnimating()
//If you want to convert any UIView, UIButton, UILabel etc. in to loader, Use:
PKLoader.shared.startAnimating(onView: <instance_of_your_view>)For Stop Loading
- Just call
stopAnimating()method withsharedinstance ofPKLoader
Example:
PKLoader.shared.stopAnimating()Configuration To Chnage Animation
To change the default configuration of the loader just change the values of PKLoaderSettings, Like:
Important Property:
indicatorTypeused to decide the loader animation type. Default:PKLoader.IndicatorType.ballRotateChase
Properties Only Useful in Case of Full Screen Loader
-
backgroundSizeused to give the size for the background view. Default:CGSize(width: 100.0, height: 100.0) -
backgroundColorused to give the background color for the background view. Default:UIColor.white -
cornerRadiusused to give the corner radius for the background view. Default:10.0 -
indicatorSizeused to give the default size for the indicator animation. Default:CGSize(width: 20.0, height: 20.0) -
indicatorColorused to give the color for the indicator animation. Default:UIColor.gray
Properties Useful in Both Case
-
indicatorPaddingused to give the padding for the indicator animation. Default:UIEdgeInsets(top: 5.0, left: 5.0, bottom: 5.0, right: 5.0) -
shouldMakeRounddecides weather make the passed view circular or not. Default:true
Licence
PKLoader is released under the MIT license.

