First of all you should use:
Import UserNotifications for local notifications.
: Xcode 8 beta 6 and Sierra beta6
some test code:
a) iOS 10 only for quick 3:
override func viewDidLoad() { super.viewDidLoad()
/ * allow center = UNUserNotificationCenter.currentNotificationCenter () center.requestAuthorizationWithOptions ([. Alert, .Sound]) {(provided, error) in} * /
// swift 3.0: let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert, .sound]) { (granted, error) in // Enable or disable features based on authorization. }
2) iOS 9 support: (I changed the deployment target)
// swift 3.0: if
source share