Search code examples
iosswiftxcodeswiftuixcode11

Unresolved identifier NavigationButton error


I'm new to swiftUI and just trying to figure out the basics. I'm simply trying to create a new view and a button that will move to it.

When I use the code below, an error appears: "Use of unresolved identifier 'NavigationButton'" despite that being generated by Xcode.

import SwiftUI

struct HomeView: View {

    var body: some View{
        NavigationView {
            NavigationButton(destination: NextView()) {
                Text("Navigate 1")}
        }
    }
}

Solution

  • NavigationButton changed to NavigationLink for a while now. So replace it and use it.