Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols #9

Closed
andreyz opened this issue Aug 11, 2020 · 3 comments · Fixed by #10
Closed

Comments

@andreyz
Copy link

andreyz commented Aug 11, 2020

Following compilation errors prevent Gala 0.3.3 from building with Xcode 11.6:

Gala/Sources/Gala/Gala.swift:28:5: error: type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols
    ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
    ^
Gala/Sources/Gala/Gala.swift:28:5: note: required by referencing initializer 'init(_:id:content:)' on 'ForEach' where 'Content' = '()'
    ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
    ^
Gala/Sources/Gala/Gala.swift:46:5: error: type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols
    ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
    ^
Gala/Sources/Gala/Gala.swift:46:5: note: required by referencing initializer 'init(_:id:content:)' on 'ForEach' where 'Content' = '()'
    ForEach([UserInterfaceSizeClass.compact, .regular], id: \.self) { item in
    ^
Gala/Sources/Gala/Gala.swift:70:5: error: type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols
    ForEach([LegibilityWeight.regular, .bold], id: \.self) { item in
    ^
Gala/Sources/Gala/Gala.swift:70:5: note: required by referencing initializer 'init(_:id:content:)' on 'ForEach' where 'Content' = '()'
    ForEach([LegibilityWeight.regular, .bold], id: \.self) { item in
    ^
@finestructure
Copy link
Owner

Ooops, looks like I broke 11.6 when I fixed the Xcode 12 beta. Thanks for reporting it!

@finestructure
Copy link
Owner

That should be fixed in 0.3.4, please let me know if you're still having problems!

@andreyz
Copy link
Author

andreyz commented Aug 11, 2020

Works great in both Xcode 11.6 and 12 beta 4. Thank you for a useful library and a very quick patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants