Adjusted the progress bar so that it will make it to 100%

This commit is contained in:
Maurice Parker
2019-09-14 17:53:37 -05:00
parent bec1aacffc
commit 612d7d0755
2 changed files with 18 additions and 22 deletions

View File

@@ -45,7 +45,6 @@ public final class NavigationProgressView: UIView {
}
}
/* ====================================================================== */
// MARK: - initializer
/* ====================================================================== */
@@ -119,14 +118,15 @@ public final class NavigationProgressView: UIView {
// MARK: - Method
/* ====================================================================== */
internal func setProgress(_ progress: Float, animated: Bool) {
let duration: TimeInterval = animated ? 0.1 : 0
internal func setProgress(_ progress: Float, animated: Bool, completion: @escaping () -> Void) {
let duration: TimeInterval = animated ? 0.2 : 0
self.progress = progress
UIView.animate(withDuration: duration, animations: {
self.layoutIfNeeded()
})
UIView.animate(withDuration: duration, animations: { self.layoutIfNeeded() }) { _ in
completion()
}
}
}