Presenting a local notification immediately
suggest changeIf you want to show local notification immediately, you should call:
Swift 3
UIApplication.shared.presentLocalNotificationNow(notification)
Swift 2
UIApplication.sharedApplication().presentLocalNotificationNow(notification)
Objective-C
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
An advantage of using this is so you won’t have to set the fireDate
and timeZone
properties of your UILocalNotification
object.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents