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

Investigate usage of SwiftUI Preferences #20

Closed
1 task done
Supereg opened this issue Sep 15, 2023 · 1 comment
Closed
1 task done

Investigate usage of SwiftUI Preferences #20

Supereg opened this issue Sep 15, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Supereg
Copy link
Member

Supereg commented Sep 15, 2023

Problem

Currently, we rely on custom built mechanics to pass data up the SwiftUI View hierarchy (e.g. for Validation and for data collected in Signup and Overview views).

Solution

SwiftUI has a dedicated mechanism to pass data up the view hierarchy using Preferences.

We should investigate how we could simplify the current infrastructure by using SwiftUI Preferences. This includes the following actions points:

  1. One could replace the ValidationEngines type and introduce a mechanism for ValidationEngines to pass up a submit validation hook (e.g. a view having a submit/save/done button could collect these closures/or validation engine from it's subviews).
  2. DataEntry views could pass up their input values using preferences. Though not sure if they are considered a "preference"(?).

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@Supereg Supereg added the enhancement New feature or request label Sep 15, 2023
@Supereg Supereg changed the title Investiere usage of SwiftUI Perferences Investigate usage of SwiftUI Preferences Sep 15, 2023
@PSchmiedmayer PSchmiedmayer moved this to Backlog in Project Planning Sep 16, 2023
@Supereg
Copy link
Member Author

Supereg commented Dec 12, 2023

Validation logic was moved out into SpeziValidation. See #35. PreferenceKeys were considered as a core mechanisms to move state around the view hierarchy.

@Supereg Supereg closed this as completed Dec 12, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Done in Project Planning Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

1 participant