Skip to content

Execute after ○ seconds, execute every second

   

Here's a sample that runs every second, after a few seconds in Swift.
It is output to the console every second.

for i in 0..<100 {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5*Double(i)) {
print(i)
}
}

  1. Setting a header in UITableView
  2. Adding a Custom Cell to UICollectionView
  3. UICollectionView
  4. Skip the Export Compliance Wizard
  5. Obtaining JSON from the API using Alamofire
  6. Calling a method from another View in a delegate
  7. Get and display the class name, function name and line number in Swift