From 708532016b752be903b1d1d251646027fcd0e303 Mon Sep 17 00:00:00 2001 From: Andreas Ganske Date: Wed, 20 Oct 2021 11:14:39 +0200 Subject: [PATCH] Add missing methods for HMActionSet and HMEventTrigger --- Sources/HMActionSet+Promise.swift | 7 +++++++ Sources/HMEventTrigger+Promise.swift | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Sources/HMActionSet+Promise.swift b/Sources/HMActionSet+Promise.swift index b566285..68f6004 100644 --- a/Sources/HMActionSet+Promise.swift +++ b/Sources/HMActionSet+Promise.swift @@ -14,6 +14,13 @@ extension HMActionSet { self.addAction(action, completionHandler: seal.resolve) } } + + @available(iOS 8.0, *) + public func removeAction(_ action: HMAction) -> Promise { + return Promise { seal in + self.removeAction(action, completionHandler: seal.resolve) + } + } @available(iOS 8.0, *) public func updateName(_ name: String) -> Promise { diff --git a/Sources/HMEventTrigger+Promise.swift b/Sources/HMEventTrigger+Promise.swift index 1446d1a..20f5d3b 100644 --- a/Sources/HMEventTrigger+Promise.swift +++ b/Sources/HMEventTrigger+Promise.swift @@ -15,6 +15,34 @@ extension HMEventTrigger { self.updateExecuteOnce(executeOnce, completionHandler: seal.resolve) } } + + @available(iOS 11.0, *) + public func updateEvents(_ events: [HMEvent]) -> Promise { + return Promise { seal in + self.updateEvents(events, completionHandler: seal.resolve) + } + } + + @available(iOS 11.0, *) + public func updateEndEvents(_ events: [HMEvent]) -> Promise { + return Promise { seal in + self.updateEndEvents(events, completionHandler: seal.resolve) + } + } + + @available(iOS 9.0, *) + public func updatePredicate(_ predicate: NSPredicate?) -> Promise { + return Promise { seal in + self.updatePredicate(predicate, completionHandler: seal.resolve) + } + } + + @available(iOS 11.0, *) + public func updateRecurrences(_ recurrences: [DateComponents]?) -> Promise { + return Promise { seal in + self.updateRecurrences(recurrences, completionHandler: seal.resolve) + } + } }