
Latest article • Swift
If you need to trigger an action or send a message after a certain period of time, use the Timer class, which lets you schedule actions to run in the future, with or without repetition. Timer.scheduledTimer(withTimeInterval: 2.0, repeats: false) { _ in print("Two seconds have passed!"