title: How to make one code run only after the other is done in Swift
body: <p>I am new to async and sync mechanism.
  In my code I have to perform one code line only after the other is done.
  It looks something like this:</p>
  
  <pre><code>    func something(){
  
      let workerQueue = DispatchQueue.global(qos: .userInitiated)
              workerQueue.async{
           let info = getInfoFromTheWeb()//I need the info value in order to perform the next line
           saveToDB(info: info)
  
        DispatchQueue.main.async {
         //update a label text in the ui after getting and saving that info
        }
  
      }
  }
  </code></pre>
  
  <p>Your professional thoughts please..</p>