Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Swift Data to Store Tasks and Events #20

Open
1 task done
PSchmiedmayer opened this issue Jul 30, 2023 · 1 comment · May be fixed by #44
Open
1 task done

Use Swift Data to Store Tasks and Events #20

PSchmiedmayer opened this issue Jul 30, 2023 · 1 comment · May be fixed by #44
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@PSchmiedmayer
Copy link
Member

PSchmiedmayer commented Jul 30, 2023

Problem

The current usage of the local storage module to store tasks and events is functional but not ideal. It provides limited functionality when querying for tasks and events and does allow limited access to the types from outside of the scheduler module.

Solution

Using Swift Data should allow more flexible querying of data for the scheduler module. Swift Data should also allow views to provide custom queries for tasks and events and reduce the number of redraws of SwiftUI-based views.

The functionality of initializing elements such as notifications should ideally be moved in the types themselves to allow developers to even create tasks outside of the Scheduler module without requiring them to register them with the Scheduler module.

Additional context

You can learn more about Swift Data here: https://developer.apple.com/xcode/swiftdata/

Feel free to use this issue to discuss ideas on how to best implement this functionality and how to improve the internal workings of the Scheduler module.

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@PSchmiedmayer PSchmiedmayer added enhancement New feature or request help wanted Extra attention is needed labels Jul 30, 2023
@PSchmiedmayer
Copy link
Member Author

Spezi Scheduler is currently doing all scheduling, planning, and storage of tasks is happening locally on the device. In addition, we have several issues that we have to address here.

In the long run I would suggest that we address some of these elements by multiple elements:

  1. Make Spezi Scheduler based on Swift Data for a better query performance and flexibility
  2. Use the custom Swift Data Storage Backends in iOS 18 to enable local storage using the default Core Data storage as well as an option to write a Firebase/other cloud provider backend storage.
  3. Utilize the new iOS 18 versioned data storage functionality and other extensions to facilitate versioning similar to CareKit which has implemented it internally
  4. Extend the data model to support the storage of different types of tasks including the elements defined in this task.

So far, Spezi Scheduler has served us well for limited use cases but we definitely need more attention and IMO a general strategy shift for this package and I could see a re-architecting of the structure using Swift Data as a great starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Next Steps
1 participant