title: How to ensure calls are done serially in swift3 app using GCD
body: <p>I need this block of code to run in order: </p>
  
  <pre><code>UIApplication.shared.beginIgnoringInteractionEvents()
  loadDataTask.resume()
  UIApplication.shared.endIgnoringInteractionEvents()
  </code></pre>
  
  <p>It's being run inside of <code>DispatchQueue.main.async()</code> (every network call is that's why I'm trying to temporarily block user input). I am still learning swift and struggling a little with the GCD concept. Any recommendations would be very much appreciated. </p>