Closed Supereg closed 1 month ago
Attention: Patch coverage is 62.63191%
with 602 lines
in your changes missing coverage. Please review.
Project coverage is 63.11%. Comparing base (
896eb44
) to head (19139c5
). Report is 1 commits behind head on main.
New Task model using SwiftData and Schedule creation using Calendar Recurrence Rule
:recycle: Current situation & Problem
This PR completely rethinks the Scheduler package. We introduce an updated Task model that is completely backed by SwiftData. Further, we provide a new
Schedule
model that provides greater flexibility for formulating recurring events. Instead of formulating events based on intervals usingDateComponents
, we use the newRecurrenceRule
infrastructure introduced with iOS 18.Using a
Schedule
, you can generate a potentially infinite list ofOccurrence
s. ATask
uses the occurrences of its Schedule to generateEvents
. When events are marked as completed, they are associated with anOutcome
. Both aTask
and anOutcome
can be extended with arbitrary data. This is enabled using the@Property
macro, that allows to define custom properties on tasks and outcomes using aSharedRepository
-backed storage implementation.Task
are stored in an versioned, append-only store. Modifying the contents of a Task (e.g., instructions, schedules, ...), appends a new Task version and marks it as effective for the specified date. This allows to modify tasks without changing previous events or occurrences. Something that was impossible with the previous implementation.Lastly, the updated Scheduler provides additional support for UI components out of the box. We provide the new
@EventQuery
property wrapper that you can use in your SwiftUI views. It allows to easily and efficiently query Events directly in SwiftUI. Additionally, we provide several, reusable UI components out of the box to visualize events in your application.Notifications are currently no longer supported with this version of SpeziScheduler: https://github.com/StanfordSpezi/SpeziScheduler/issues/45 (This is now tackled in https://github.com/StanfordSpezi/SpeziScheduler/pull/49 which will most likely be merged alongside this PR).
An example of how to configure tasks with this new model is depicted below:
:gear: Release Notes
@EventQuery
property wrapper to easily query events in your SwiftUI view.Breaking Changes
:books: Documentation
The documentation catalog was completely restructured, highlighting all the new API and functionality.
:white_check_mark: Testing
New unit and UI tests have been written to verify functionality. We aimed to set a focus on unit tests for fastest possible test execution.
:pencil: Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: