Adding a Local Notification

Now you are going to implement the reminder feature using a local notification. A local notification is a way for an application to alert the user even when the application is not currently running.

(An application can also use push notifications that are implemented using a backend server. For more about push notifications, read Apple’s Local and Push Notification Programming Guide.)

Getting a local notification to display is easy. You create a UILocalNotification and give it some text and a date. Then you schedule the notification with the shared application – the single instance of UIApplication.

Update the addReminder: method to do this:

-​ ​(​I​B​A​c​t​i​o​n​)​a​d​d​R​e​m​i​n​d​e​r​:​(​i​d​)​s​e​n​d​e​r​ ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.