I have the following,
class someViewController : ViewController{
var timer:Timer? = nil
override func viewDidLoad() {
timer = Timer.scheduledTimer(timeInterval: 5.0, target: self, selector: #selector(fire), userInfo: nil, repeats: true)
}
@objc func fire(){
print("fired")
}
}
The fire function is never hit and I can't figure out why, what am I missing?
question from:https://stackoverflow.com/questions/66064694/swift-5-timer-not-firing