Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't click a NavigationLink in List (SwiftUI)

I can't click on a NavigationLink in a List after the Xcode update to Beta 3. The row is gray for some reason.

enter image description here

Here's the code:

List {
        Section {

            NavigationLink(destination: Text("ProfileView")) {
                Text("Profil")
            }

            NavigationLink(destination: Text("Einstellungen")) {
                Text("Einstellungen und Datenschutz")
            }
        }
    }
like image 930
SwiftiSwift Avatar asked Dec 22 '22 22:12

SwiftiSwift


1 Answers

List should be inside NavigationView,

Update your code as mentioned below,

NavigationView {
    List {
        Section {

            NavigationLink(destination: Text("ProfileView")) {
                Text("Profil")
            }

            NavigationLink(destination: Text("Einstellungen")) {
                Text("Einstellungen und Datenschutz")
            }
        }
    }
}
like image 55
iGatiTech Avatar answered Dec 25 '22 12:12

iGatiTech