Closed Supereg closed 1 month ago
Attention: Patch coverage is 38.33333%
with 74 lines
in your changes missing coverage. Please review.
Project coverage is 73.12%. Comparing base (
2de0720
) to head (66d71c1
). Report is 1 commits behind head on main.
Model
Account
andAccountService
as Spezi Module:recycle: Current situation & Problem
The
Account
model andAccountService
s were introduced before Spezi had sophisticated support for Modules. Therefore, SpeziAccount provides infrastructure like the@AccountReference
to access theAccount
model from certain places like an Account Service or from a Standard that conforms to a SpeziAccount constraint. Other than that, theAccount
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) accessAccount
from a Spezi Module and (b) access Spezi Modules from within anAccountService
. Typically this involves nesting Account Services into basically empty Spezi Modules or injecting ViewModifiers into the global SwiftUI view hierarchy to get access to theAccount
.This PR addresses the problem by making
Account
andAccountServices
Spezi Modules that can be used with all Spezi infrastructure like the@Dependency
property wrapper. This greatly improves flexibility when developing with SpeziAccount.:gear: Release Notes
@Dependency
property wrapper.AccountService
s are now Spezi Modules that can use Spezi infrastructure.:books: Documentation
TBA
:white_check_mark: Testing
--
:pencil: Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: