title: Multiple requests with DispatchQueue.main.async not executing properly in swift 3
body: <p>I have a JSON through which I get list of boards. Can be accessed by self.jsonGame.boards. Now I have to call all these boards and display the content from it. </p>
  
  <p>But the boards are not consistently called. They’ll only show up sometimes.</p>
  
  <pre><code>func fetchBoard(){
  
      let repo = GameRepository()
      let prefs = UserDefaults.standard
      if self.jsonGame.boards.count &gt; 0 {
          self.sortedBoardArr.reserveCapacity(self.BoardArr.count)
  
          for board in self.jsonGame.boards{
  
              DispatchQueue.main.async
              {
                      repo.GetBoardInfo(gameID: self.jsonGame.Id, boardID: board ,  completion : {(response , errorCode ) -&gt; Void in
  
                          if errorCode == ErrorCode.NoError{
                              DispatchQueue.main.sync {
  
                                  self.BoardArr.append(response)
                                  self.sortArr()
                                  self.collectionView.reloadData()
  
                              }
                          }
  
                      })
              }
          }
      }
  }
  
  func sortArr(){
      if self.jsonGame.boards.count == self.BoardArr.count{
          for board in self.jsonGame.boards{
              for boardarr in self.BoardArr{
                  if boardarr.id == board{
                      self.sortedBoardArr.append(boardarr)
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>If anyone can help me figure out how to make sure the boards are called with a consistency.</p>
  
  <p>I'm noob at async handling. Sorry for the trouble. </p>