Jaisan Mathew
Jaisan Mathew

Reputation: 23

local notification not working at the exact time as selected from datepicker but after a few seconds in swift 3

enter code hereI'm new in swift 3.currently i'm working to make a local notification on setting a note and giving a notification time using date picker.my problem is notification is getting fired only after a few seconds(say sometimes 5sec,34sec,18 sec etc) after the notification firedate.

i got the code from http://jamesonquave.com/blog/local-notifications-in-ios-8-with-swift-part-1/

thank you

Upvotes: 1

Views: 204

Answers (1)

ebby94
ebby94

Reputation: 3152

I found this answer that says UILocalNotification fire time isn't that accurate. I was also going through Apple's documentation on Timer and found this regarding timer tolerance

The system reserves the right to apply a small amount of tolerance to certain timers regardless of the value of the tolerance property.

Since the scheduled notification will be using a timer behind the scenes, the system must be applying a small tolerance to improve power saving. If you want to read more about timer tolerance read this Apple's documentation on timer.

Upvotes: 1

Related Questions