Skip to content

Commit

Permalink
Merge pull request #7 from ChaosCoder/addMissingMethods
Browse files Browse the repository at this point in the history
Add missing methods for HMActionSet and HMEventTrigger
  • Loading branch information
mxcl authored Oct 20, 2021
2 parents 668abe7 + 7085320 commit 051008a
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 051008a

Please sign in to comment.