Skip to content

Commit

Permalink
Add missing methods for HMActionSet and HMEventTrigger
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosCoder committed Oct 20, 2021
1 parent 668abe7 commit 7085320
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/HMActionSet+Promise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ extension HMActionSet {
self.addAction(action, completionHandler: seal.resolve)
}
}

@available(iOS 8.0, *)
public func removeAction(_ action: HMAction) -> Promise<Void> {
return Promise { seal in
self.removeAction(action, completionHandler: seal.resolve)
}
}

@available(iOS 8.0, *)
public func updateName(_ name: String) -> Promise<Void> {
Expand Down
28 changes: 28 additions & 0 deletions Sources/HMEventTrigger+Promise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,34 @@ extension HMEventTrigger {
self.updateExecuteOnce(executeOnce, completionHandler: seal.resolve)
}
}

@available(iOS 11.0, *)
public func updateEvents(_ events: [HMEvent]) -> Promise<Void> {
return Promise { seal in
self.updateEvents(events, completionHandler: seal.resolve)
}
}

@available(iOS 11.0, *)
public func updateEndEvents(_ events: [HMEvent]) -> Promise<Void> {
return Promise { seal in
self.updateEndEvents(events, completionHandler: seal.resolve)
}
}

@available(iOS 9.0, *)
public func updatePredicate(_ predicate: NSPredicate?) -> Promise<Void> {
return Promise { seal in
self.updatePredicate(predicate, completionHandler: seal.resolve)
}
}

@available(iOS 11.0, *)
public func updateRecurrences(_ recurrences: [DateComponents]?) -> Promise<Void> {
return Promise { seal in
self.updateRecurrences(recurrences, completionHandler: seal.resolve)
}
}

}

Expand Down

0 comments on commit 7085320

Please sign in to comment.