title: swift3 - update ui with data from background
body: <p>having hard time with UI updating with data from background thread. I read tons of docs but still missing something...</p>
  
  <pre><code>func getData(){
      DispatchQueue.global(qos: .background).async {
          let token = GetTokenOperation()
  
          token.success = { item in
              print("Success")
          }
  
          token.failure = {error in
              print(error.localizedDescription)
          }
  
          NetworkQueue.shared.addOperation(op: token)
  
          DispatchQueue.main.async {
              // qos' default value is ´DispatchQoS.QoSClass.default`
              self.updateUI()
          }
      }
  
  }
  </code></pre>
  
  <p>self.updateUI() is executed before "Success" is printed. When I put self.updateUI() inside of the closure token.success it crashes indeed.</p>