I'm trying to pass in a destination View Struct to another view, but the code won't compile.
I want to pass in some struct that conforms to the view protocol, so it can be used in a navigation button destination, but I can't seem to get it to compile. I've tried setting the type of destination to _View as well. Any suggestions are much appreciated.
struct AnimatingCard : View {
var title, subtitle : String
var color : Color
var destination : View
init(title : String, subtitle: String, color: Color, destination : View){
self.title = title
self.subtitle = subtitle
self.color = color
self.destination = destination
}
var body: some View {
NavigationButton(destination: destination) {
...
}
}
}