iOS UILocalNotification Presenting a local notification immediately

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

If 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.



Got any iOS Question?