diff --git a/DLLocalNotifications/DLLocalNotifications.swift b/DLLocalNotifications/DLLocalNotifications.swift index c0a9d07..b2449dc 100755 --- a/DLLocalNotifications/DLLocalNotifications.swift +++ b/DLLocalNotifications/DLLocalNotifications.swift @@ -141,6 +141,24 @@ public class DLNotificationScheduler{ } + func scheduleCategories(categories:[DLCategory]) { + + var categories1 = Set() + + for x in categories { + + categories1.insert(x.categoryInstance!) + } + UNUserNotificationCenter.current().setNotificationCategories(categories1) + + + + } + + + + + } // Repeating Interval Times @@ -150,6 +168,37 @@ enum Repeats: String { } +// A wrapper class for creating a Category + +public class DLCategory { + + private var actions:[UNNotificationAction]? + internal var categoryInstance:UNNotificationCategory? + var identifier:String + + + init (categoryIdentifier:String) { + + identifier = categoryIdentifier + + } + + func addActionButton(identifier:String?, title:String?) { + + let action = UNNotificationAction(identifier: identifier!, title: title!, options: []) + actions?.append(action) + categoryInstance = UNNotificationCategory(identifier: self.identifier, actions: self.actions!, intentIdentifiers: [], options: []) + + } + + + + + +} + + + // A wrapper class for creating a User Notification