I am trying to print something to the consol when my progress view reaches its max value. I have a long press gesture recogniser on the progress view where the user holds the view down for 5 seconds and that increases the progress views value. I would like to print something to the consol when the progress view value reaches the max value.
I have tried something along the lines of
if progressView.value == 5 {
print("message")
}
This prints the message as soon as the user presses the view, it doesnt wait until the value = 5.
I am using MBCircularProgressBarView
Thanks
@IBAction func buttonPressed(_ sender: UILongPressGestureRecognizer) {
if sender.state == .began {
UIView.animate(withDuration: 5) {
self.progressView.value = 5
}
}
if sender.state == .ended {
UIView.animate(withDuration: 2) {
self.progressView.value = 0
}
}
}