I'm trying to use a Link in a SwiftUI view, and like every tutorial online, I'd like to use this one:
Link(destination: URL, label: () -> View)
It pops up as one of the autocomplete options, but as soon as I add it to my code, I get these three errors:
Extra arguments at positions #1, #2 in call
Missing arguments for parameters 'rel', 'href', 'method' in call
Static method 'buildExpression' requires that 'Link' conform to 'View'
It looks like Xcode wants to force me to use this Link instead:
Link(rel: String, href: String, method: String)
but I don't understand why Xcode won't let me use the first one. Does anyone know why this is happening? Is there something I need to import to get this to work?
I've tried removing the Link
and re-adding it, as well as restarting Xcode.