title: For Loop wait and delay - Swift 4
body: <p>I have a nested for loop, and am trying to make it so that the outer loop will only continue once the inner loop and its code is completed, and also add a 1 second delay before performing the next loop.</p>
  
  <pre><code>    for _ in 0...3 {
          for player in 0...15 {
              // CODE ADDING MOVEMENTS TO QUEUE
          }
          updateBoardArray()
          printBoard()
  
          // NEED TO WAIT HERE FOR 1 SEC
      }
  </code></pre>
  
  <p>So I wan't the 0...3 For loop to progress only once the inner loop and update and print functions have completed their cycle, and also a 1 second wait time.</p>
  
  <p>At the moment it all happens at once and then just prints all 4 boards instantly, even when I put that 1 second wait in using DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {}.</p>
  
  <p>Have tried other answers to similar questions but can't seem to get it to work.</p>