Answers for "timer of 10 sec in swift"

4

use timer swift

Timer.scheduledTimer(timeInterval: 1, 
    target: self, 
    selector: #selector(YourController.update), 
    userInfo: nil, 
    repeats: true)

// @objc selector expected for Timer
@objc func update() {
    // do what should happen when timer triggers an event
}
Posted by: Guest on January-31-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language