LAST CHANCE: Save 50% on all my Swift books and bundles! >>

NavigationLink warning

Forums > 100 Days of SwiftUI

I have an issue with my first challenge. I've added a helpview:

      HStack {
                        destination: HelpView(),
                        isActive: $isShowingHelp,
                        label: {
                            Text("  Help  ")

Throws this warning:

 'init(destination:isActive:label:)' was deprecated in iOS 16.0: use NavigationLink(value:label:), 
 or navigationDestination(isPresented:destination:), inside a NavigationStack or NavigationSplitView                   

Works fine, tho. How can I fix this?


Try this

struct ContentView: View {
    @State private var isShowingHelp = false

    var body: some View {
        NavigationStack {
            Button {
            } label: {
            .navigationDestination(isPresented: $isShowingHelp) {


Thanks for the reply,

Throws this error:

Closure containing a declaration cannot be used with result builder 'ViewBuilder'

Edit: Fixed! Thanks so much, I think I misapplied your fix, started from scratch and the error is gone.


The code that above does not give any errors. So will be something esle.


Hacking with Swift is sponsored by Essential Developer.

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until July 28th.

Click to save your free spot now

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

Reply to this topic…

You need to create an account or log in to reply.

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.