Put a slight delay in hiding the progress bar

This commit is contained in:
Maurice Parker 2019-09-14 18:11:03 -05:00
parent 612d7d0755
commit 11140f2289
1 changed files with 9 additions and 5 deletions

View File

@ -106,22 +106,26 @@ public extension UINavigationController {
func finishProgress() { func finishProgress() {
progressView.bar.alpha = 1 progressView.bar.alpha = 1
progressView.setProgress(1, animated: true) { progressView.setProgress(1, animated: true) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
UIView.animate(withDuration: 0.5, animations: { self.progressView.bar.alpha = 0 }) { finished in UIView.animate(withDuration: 0.5, animations: { self.progressView.bar.alpha = 0 }) { finished in
self.progressView.progress = 0 self.progressView.progress = 0
} }
} }
} }
}
/** /**
While progress is changed to 0.0, the bar will fade out. While progress is changed to 0.0, the bar will fade out.
*/ */
func cancelProgress() { func cancelProgress() {
progressView.setProgress(0, animated: true) { progressView.setProgress(0, animated: true) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
UIView.animate(withDuration: 0.5, animations: { UIView.animate(withDuration: 0.5, animations: {
self.progressView.bar.alpha = 0 self.progressView.bar.alpha = 0
}) })
} }
} }
}
func updateAccountRefreshProgressIndicator() { func updateAccountRefreshProgressIndicator() {