Closed vishnuravi closed 7 months ago
Thank you for the feedback, agree as discussed in the meeting that this is something that we should improve.
I would suggest that we store an AnyView
in the content (https://github.com/StanfordSpezi/SpeziOnboarding/blob/main/Sources/SpeziOnboarding/OnboardingInformationView.swift#L37) and make the initializer generic of a View
that can be passed in the initializer using a ViewBuilder
. This should allow you to pass in any view. Some of the modifiers in the view might need to be adjusted: https://github.com/StanfordSpezi/SpeziOnboarding/blob/main/Sources/SpeziOnboarding/OnboardingInformationView.swift#L96
Description
The
OnboardingView
allows each area to have an icon, which must be anImage
. However, we cannot currently add modifiers such as.foregroundColor()
to the icon, which limits the customizability.Reproduction
Create an
OnboardingView
and attempt to add a modifier to an icon:This results in an error:
Cannot convert value of type 'some View' to expected argument type 'Image'
Expected behavior
It should be possible to add modifiers to images.
Additional context
No response
Code of Conduct