A gradient progress bar (UIProgressView). Inspired by iOS Style Gradient Progress Bar with Pure CSS/CSS3.
GradientProgressBar can be added to your project using CocoaPods by adding the following line to your Podfile:
pod 'GradientProgressBar', '~> 1.0'
Simply drop a UIProgressView
into your View Controller in the Storyboard. Select your progress view and in the Identity Inspector
change the class to GradientProgressBar
.
Don't forget to change the module to
GradientProgressBar
too.
Setup the constraints for the UIProgressView according to your needs.
Import GradientProgressBar
in your view controller source file.
import GradientProgressBar
Create an IBOutlet
of the progress view in your view controller source file.
@IBOutlet weak var progressView: GradientProgressBar!
After that you can set the progress programmatically as you would do on a normal UIProgressView.
progressView.setProgress(0.75, animated: true)
progressView.progress = 0.75
As of version 1.1.0 you can adjust the animation duration:
progressView.animationDuration = 2.0
progressView.setProgress(progress, animated: true)
1.1.0
Felix Mau (contact(@)felix.hamburg)