generated from StanfordBDHG/SwiftPackageTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Model `Account` and `AccountService` as Spezi Module ## ♻️ Current situation & Problem The `Account` model and `AccountService`s were introduced before Spezi had sophisticated support for Modules. Therefore, SpeziAccount provides infrastructure like the `@AccountReference` to access the `Account` model from certain places like an Account Service or from a Standard that conforms to a SpeziAccount constraint. Other than that, the `Account` model can only be accessed from within the SwiftUI view hierarchy. This design is generally relatively inflexible and one has to find workarounds to (a) access `Account` from a Spezi Module and (b) access Spezi Modules from within an `AccountService`. Typically this involves nesting Account Services into basically empty Spezi Modules or injecting ViewModifiers into the global SwiftUI view hierarchy to get access to the `Account`. This PR addresses the problem by making `Account` and `AccountServices` Spezi Modules that can be used with all Spezi infrastructure like the `@Dependency` property wrapper. This greatly improves flexibility when developing with SpeziAccount. ## ⚙️ Release Notes * Account is now a Spezi Module and can be accessed from Modules using the `@Dependency` property wrapper. * `AccountService`s are now Spezi Modules that can use Spezi infrastructure. ## 📚 Documentation _TBA_ ## ✅ Testing -- ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
- Loading branch information
Showing
29 changed files
with
229 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.