Releases: Dean151/RuleKit
Releases · Dean151/RuleKit
0.5.3
0.5.2
Initial support for Swift 6 Mode
Full Changelog: 0.5.1...0.5.2
0.5.1
New delay RuleOption
What's Changed
- Add DelayOption by @divadretlaw in #1
Thanks you so much for bringing this!
Breaking changes
- Raised Swift 5.9 as minimum requirement
- Rule, RuleKitOption, TriggerFrequencyOption.Frequency are now Sendable
- condition closure for EventRule and ConditionRule are now marked with Sendable
New Contributors
- @divadretlaw made their first contribution in #1
Full Changelog: 0.4.1...0.5.0
Fixed setRule wrongly marked as async
The closure should be async, not the overall signature.
Asynchronous conditions
New features
- Added ConditionRule: allowing to have simple condition throttle. Warning: rules are checked only when an event is donated.
- ConditionRule and EventRule now take an async parameter, allowing asynchronous checking ⏲️
Breaking changes
- Removed deprecated symbols from 0.3.x
Allowing multiple ruleset for a single Notification.Name
- Added a name parameter to the Notification trigger. Each unique name will register as independent triggers, and will allow different rules for frequency, and triggers.
- Added a bit more inline documentation to available methods and parameters.
Fixed result builder
This is a fix release:
- Added back the 2.x signature for building rules
- Fixed the new result builder introduced in 0.3.0, that was broken by default
- Added tests for the public interface :D
Closure triggers!
Closures!
You may now register a closure instead of a NSNotification.Name to being triggered by RuleKit.
A closure requires a unique name to be provided for triggers history storage.
await RuleKit.setRule(triggering: {
showPaywall = true
}, rawValue: "showPaywall", options: [.triggerFrequency(.hourly)], .anyOf {
EventRule(event: .appOpened) {
Premium.currentOffering.name == "sales"
}
})
Breaking changes
- Deleted deprecated
RuleKit.Event.resetDonation()
in favor ofRuleKit.Event.resetDonations()
Improved interfaces
Most of the public structs are now under the RuleKit namespace, because some names like "Event" are too common.
Also added an example documentation