Two basic steps are required to prepare local notifications:
Step 1
In iOS 8+, your application should ask and, subsequently, give the user permission to display local notifications. Request permission can be done as follows in AppDelegate.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
...
if #available(iOS 8, *) {
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [.Sound, .Alert, .Badge], categories: nil))
}
return true
}
registerUserNotificationSettings(_:), iOS 8. . , , Swift 2.
2
fireDate.
let notification:UILocalNotification = UILocalNotification()
...
...
...
notification.fireDate = ...
UIApplication.sharedApplication().scheduleLocalNotification(notification)
, @progrmr,
UILocalNotification. (. ), . repeatInterval .
. 64 . , , ( ).
. . (url?) Apple.
. , .
3 . 6:28, 12:28 17:28, . repeatInterval 3 .CalendarUnitWeekday.