example of ViewBuilder issue#1250
example of ViewBuilder issue#1250russellwheatley wants to merge 2 commits intofacebook-google-phone-buttonsfrom
Conversation
| public var googleButton: some View { | ||
| if googleProvider != nil { | ||
| // For purpose of demonstration | ||
| // This produces "Type 'any View' cannot conform to 'View'" |
There was a problem hiding this comment.
@peterfriese - the problem is when we try to render from core package, Xcode produces this compiler error. I don't know how to get around it.
There was a problem hiding this comment.
Can you take a look at https://gist.github.com/peterfriese/d9745f366fb4f857daf077e93b1eb01f and see if this approach helps?
There was a problem hiding this comment.
@peterfriese - here is the commit attempting to follow your example: 8c38462 (#1250)
| VStack { Divider() } | ||
| EmailAuthView() | ||
|
|
||
| // Xcode compiler exception: Type 'any ExternalAuthProvider' cannot conform to 'ExternalAuthProvider' |
There was a problem hiding this comment.
@peterfriese - Following your gist example, we get this Xcode compiler error now.
I tried to remove any ExternalAuthProvider from the types in auth service for each provider but it isn't allowed because ExternalAuthProvider uses an associated type (ButtonType), Swift requires you to explicitly acknowledge it as an existential by using any ExternalAuthProvider.
Hacked together for purpose of demonstration only.