NSUserDefaults.standardUserDefaults() This will save/overwrite todo .setObject(todoDictionary, forKey: ITEMS_KEY) item list let notification = UILocalNotification() This will create the medicine notification.alertBody = "Todo Item \"\(item.title)\" reminder notification and Is Overdue" shows what the text will be on the notification. This is the text that is notification.alertAction = "open" displayed after "slide to..." on the lock screen - defaults to "slide to view" self.setBadgeNumbers() This will update the on adding new item So, when Medicine reminder notification shows the user has two choices: one is to press Complete if he took the medicine and the other option is to remind him in 30 minutes and this is the function that do the reminder: func scheduleReminderforItem(item: TodoMedicineItem) { let notification = UILocalNotification() // create a new reminder notification notification.alertBody = "Medicine Intake\"\(item.title)\" Is Overdue" // text that will be displayed in the notification notification.alertAction = "open" // text that is displayed "slide to..." on the lock screen - defaults to "slide to view" notification.fireDate = NSDate().dateByAddingTimeInterval(30 * 60) notification.soundName = UILocalNotificationDefaultSoundName // play default sound notification.userInfo = ["title": item.title, "UUID": item.UUID] notification.category = "TODO_CATEGORY" UIApplication.sharedApplication().scheduleLocalNotification(notification) } notification.fireDate = When the user choose remind me NSDate().dateByAddingTimeInterval(30 * 60) in 30 minutes this is will calculate
NSUserDefaults.standardUserDefaults() .setObject(todoDictionary, forKey: ITEMS_KEY) This will save/overwrite todo item list let notification = UILocalNotification() notification.alertBody = "Todo Item \"\(item.title)\" Is Overdue" This will create the medicine reminder notification and shows what the text will be on the notification. notification.alertAction = "open" This is the text that is displayed after "slide to..." on the lock screen - defaults to "slide to view" self.setBadgeNumbers() This will update the on adding new item So, when Medicine reminder notification shows the user has two choices: one is to press Complete if he took the medicine and the other option is to remind him in 30 minutes and this is the function that do the reminder: func scheduleReminderforItem(item: TodoMedicineItem) { let notification = UILocalNotification() // create a new reminder notification notification.alertBody = "Medicine Intake\"\(item.title)\" Is Overdue" // text that will be displayed in the notification notification.alertAction = "open" // text that is displayed "slide to..." on the lock screen - defaults to "slide to view" notification.fireDate = NSDate().dateByAddingTimeInterval(30 * 60) notification.soundName = UILocalNotificationDefaultSoundName // play default sound notification.userInfo = ["title": item.title, "UUID": item.UUID] notification.category = "TODO_CATEGORY" UIApplication.sharedApplication().scheduleLocalNotification(notification) } notification.fireDate = NSDate().dateByAddingTimeInterval(30 * 60) When the user choose remind me in 30 minutes this is will calculate
ThesisV5.docx