The timer is not working in ios 10 and above ?

0 votes
211 views
asked Apr 26 by anonymous
Hi

  I am using the below code but its not working in IOS 10 and above

 Timer.scheduledTimer(timeInterval: timeoutInSeconds, target: self, selector: #selector(idleTimerExceeded), userInfo: nil, repeats: false)

1 Answer

0 votes
answered Apr 26 by admin (8,115 points)

Hi User

  I also faced the same issue try the below changes ,In my case it worked after I added to my method the @obj prefix

@objc func idleTimerExceeded{

}

...