What does this error mean: Type '() -> cannot conform to 'View'?

I am trying to follow Apple's SwiftUI tutorials and I am getting the error: Type '() -> LandmarkRow' cannot conform to 'View'. I'm wondering what this means and how I can fix it? Thank you!

Answered by Claude31 in 696257022

To give you a clear explanation we would need to see your code.

But that means that instead of designing a view (as with Text("Hello"), you wrote a func.

So please, show code where the error occurs.

Accepted Answer

To give you a clear explanation we would need to see your code.

But that means that instead of designing a view (as with Text("Hello"), you wrote a func.

So please, show code where the error occurs.

Here is my code:

I'm also getting the same error here:

Thank you so much for your help!

You can solve this warning by using '(' instead of '{'

Here is an example :

struct CircleImage: View {
  var body: some View {
    Image("turtlerock")
      .clipShape(Circle())
      .overlay(Circle().stroke(Color.white, lineWidth: 4))
      .shadow(radius: 7)
  }
}
What does this error mean: Type '() -> cannot conform to 'View'?
 
 
Q