StanfordSpezi / SpeziAccount

The Spezi Account module to enable login and signup functionality
https://swiftpackageindex.com/StanfordSpezi/SpeziAccount/documentation/
MIT License
6 stars 5 forks source link

Support overriding the navigation title of Account Overview #48

Open Supereg opened 9 months ago

Supereg commented 9 months ago

Problem

The AccountOverview provides a default navigation title out of the box. However, in a certain context if might be desirable to override this (e.g., if an Account has a more concrete semantic like "Care Provider", ...).

Solution

With SwiftUI it is currently not possible to overwrite the navigation title from the outside (not sure why honestly?). Therefore, we would need to find a way to make such changes possible. Two straightforward approaches would be to a) just add a new init parameter to specify an optional argument or b) just remove the default navigation title and allow complete customization. Approach a) is probably that least SwiftUI-like approach.

Additional context

No response

Code of Conduct

PSchmiedmayer commented 9 months ago

Approach b) probably makes sense. There is probably no way to inspect the navigation title from the environment to see if it was already defined from an outside view? If not, I would probably suggest to remove the internal usage and allow that to be defined by the user of the view.