I am playing with ProgressView. What I want to achieve is stopping at 33%, 66%, 100% checkpoints on button click. It's working okay if I use progressView.progress = 0.33
, but it directly lands to the checkpoint. Instead, having it smooth and accelerating would look so nice.
I thought animateWithDuration
would work but unfortunately it doesn't. After some reading, I found out that I can do something with NSTimer, but I couldn't achieve it.
var progressView: UIProgressView?
override func viewDidLoad()
{
super.viewDidLoad()
progressView = UIProgressView(progressViewStyle: UIProgressViewStyle.Default)
progressView?.center = self.view.center
progressView?.trackTintColor = UIColor.redColor()
progressView?.progressTintColor = UIColor.greenColor()
view.addSubview(progressView!)
progressView!.progress = 0.0
}
Using this answer, I achieved making it move once in every second, but how can I make it go smooth, slow in the beginning and accelerating, so looks nice.