title: How to update UIProgressView below navigation controller properly?
body: <p>My goal is progress bar below the navigation bar, which works absolutely fine as you can see on this screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/IW7PJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IW7PJ.png" alt="enter image description here"></a></p>
  
  <p>Here is the code which creates this:</p>
  
  <pre><code>class NavigationController: UINavigationController {
  
      let progressView = UIProgressView(progressViewStyle: .Bar)
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          progressView.progress = 0.9
          view.addSubview(progressView)
  
          let bottomConstraint = NSLayoutConstraint(item: navigationBar, attribute: .Bottom, relatedBy: .Equal, toItem: progressView, attribute: .Bottom, multiplier: 1, constant: 1)
          let leftConstraint = NSLayoutConstraint(item: navigationBar, attribute: .Leading, relatedBy: .Equal, toItem: progressView, attribute: .Leading, multiplier: 1, constant: 0)
          let rightConstraint = NSLayoutConstraint(item: navigationBar, attribute: .Trailing, relatedBy: .Equal, toItem: progressView, attribute: .Trailing, multiplier: 1, constant: 0)
  
          progressView.translatesAutoresizingMaskIntoConstraints = false
          view.addConstraints([bottomConstraint, leftConstraint, rightConstraint])
          progressView.setProgress(0.8, animated: true)
      }
  }
  </code></pre>
  
  <p>But when I am trying to update the progress value by pressing the upload button, </p>
  
  <pre><code>for value in [0.0, 0.25, 0.5, 0.75, 1.0] {
      NSThread.sleepForTimeInterval(0.5)
      let navC = navigationController as! NavigationController // shorthand
      navC.progressView.setProgress(Float(value), animated: true)
      let isMainThread = NSThread.isMainThread() // yes, it is main thread
      let currentValue = navC.progressView.progress // yes, the value is updated
  }
  </code></pre>
  
  <p>nothing happens, but for the last value <code>1.0</code> suddenly the progress is full. What am I doing wrong? </p>