func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { registerNotificationTypes() return true } func registerNotificationTypes() { let types: UIUserNotificationType = .Badge | .Sound | .Alert; let one = UIMutableUserNotificationAction() one.identifier = "one" one.title = "One" one.activationMode = .Foreground one.destructive = false one.authenticationRequired = false let two = UIMutableUserNotificationAction() two.identifier = "two" two.title = "Two" two.activationMode = .Foreground two.destructive = false two.authenticationRequired = false let three = UIMutableUserNotificationAction() three.identifier = "three" three.title = "Three" three.activationMode = .Foreground three.destructive = false three.authenticationRequired = false let category = UIMutableUserNotificationCategory() category.identifier = "SAMPLE_CATEGORY" category.setActions([one, two, three], forContext: .Default) category.setActions([two, three], forContext: .Minimal) let categories = NSSet(object: category) let settings = UIUserNotificationSettings(forTypes: types, categories: categories) UIApplication.sharedApplication().registerUserNotificationSettings(settings) } func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) { println("Received local notification") } func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void) { println("Handle action \(identifier)") completionHandler() } func scheduleLocalNotification() { let notification = UILocalNotification() notification.fireDate = NSDate().dateByAddingTimeInterval(10) notification.alertBody = "This is a notification alert" notification.alertAction = "View Notification" notification.soundName = UILocalNotificationDefaultSoundName notification.applicationIconBadgeNumber = 1 notification.category = "SAMPLE_CATEGORY" UIApplication.sharedApplication().scheduleLocalNotification(notification) }