TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Swift On Sundays - Dad Jokes - MacOS NavigationLink issue

Forums > SwiftUI

Hello, I'm getting a vague error message on the Navigation link that I'm unable to resolve on MacOS only.

The error is on the line with NavigationLink(destination: ...

Error - Unnamed argument #2 must precede argument 'destination'

NavigationLink(destination:
Text(joke.punchline).frame(maxWidth: .infinity,
maxHeight: .infinity)) {

Can anyone assist? The implimentation of NavigationLink looks correct as far as I can tell from documentation and other code I've found.

Thanks!

2      

Did you try keeping them on one line?

NavigationLink(destination: Text(joke.punchline).frame(maxWidth: .infinity, maxHeight: .infinity)) { ...

I'm not suggesting that's the issue, just eliminating possibilities. Also, it might have to do with what comes after the brace.

2      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.