title: Delaying the loop (countdown func)
body: <p>I've looked at many articles, none of the answers are correct. I know that these methods work, but inside a for-loop they don't. How can I create a countdown func - where I can print an array with a one second delay in between.</p>
  
  <pre><code>let array = [9, 8, 7, 6, 5, 4, 3, 2, 1]
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>for n in array {
              DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                  print(n)
              }
          }
  </code></pre>
  
  <p>And it prints <strong>all the numbers</strong> after 1 second. So I tried this:</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  let timer = Timer.scheduledTimer(timeInterval: 2, target: self, selector: (#selector(printer)), userInfo: nil, repeats: true)
  }
  
  @objc func printer() {
      for n in array {
         print(n)
          }
      }
  </code></pre>
  
  <p>Same result. I guess these are good methods, but something's wrong.</p>