Skip to content

Type mismatch: inferred type is ContentView2 but () -> View was expected #159

Answered by marcprux
swift-jpg asked this question in Q&A
Discussion options

You must be logged in to vote

Rather than doing this:

                NavigationLink(destination: ContentView2()){
                    Label("Click Me", systemImage: "hand.wave")}
                }

I think you need to do this (note the extra braces):

                NavigationLink(destination: { ContentView2() }){
                    Label("Click Me", systemImage: "hand.wave")}
                }

This is due to difficulty Skip has with supporting the autoclosure-style argument for the NavigationLink. Please try that out and let us know if it helps.

NOTE: I'm not sure if this is related, but after installing Skip when creating a new swift file in Xcode, I no longer have an option to rename the swift file before it …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@swift-jpg
Comment options

@aabewhite
Comment options

Answer selected by swift-jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants