To run the example project, clone the repo, and run pod install
from the Example directory first.
To use JHSpinner, simply call the JHSpinnerView.showOnView(... function. There are a variety of optional parameters you can use to customize features such as the overlay type, colors, spinner animation speed, and text.
Rounded Square:
let spinner = JHSpinnerView.showOnView(view, spinnerColor:UIColor.redColor(), overlay:.RoundedSquare, overlayColor:UIColor.blackColor().colorWithAlphaComponent(0.6))
view.addSubview(spinner)
Square:
let spinner = JHSpinnerView.showOnView(view, spinnerColor:UIColor.redColor(), overlay:.Square, overlayColor:UIColor.blackColor().colorWithAlphaComponent(0.6))
view.addSubview(spinner)
Circular:
let spinner = JHSpinnerView.showOnView(view, spinnerColor:UIColor.redColor(), overlay:.Circular, overlayColor:UIColor.blackColor().colorWithAlphaComponent(0.6))
view.addSubview(spinner)
FullScreen:
let spinner = JHSpinnerView.showOnView(view, spinnerColor:UIColor.redColor(), overlay:.FullScreen, overlayColor:UIColor.blackColor().colorWithAlphaComponent(0.6))
view.addSubview(spinner)
Custom (the Custom enum value requires parameters to specify size and corner radius):
let spinner = JHSpinnerView.showOnView(view, spinnerColor:UIColor.redColor(), overlay:.Custom(CGSize(width: 300, height: 200), 20), overlayColor:UIColor.blackColor().colorWithAlphaComponent(0.6), fullCycleTime:4.0, text:"Loading")
view.addSubview(spinner)
Determinite (modify the spinner's progress property to update the circular loading indicator):
let spinner = JHSpinnerView.showDeterminiteSpinnerOnView(self.view)
spinner.progress = 0.0
view.addSubview(spinner)
To remove a spinner:
spinner.dismiss()
iOS8+
JHSpinner is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "JHSpinner"
JHays, [email protected]
JHSpinner is available under the MIT license. See the LICENSE file for more info.