Updated for Xcode 14.0 beta 1
If you have a NavigationLink
or Picker
that isn’t working, this usually happens because SwiftUI expects the containing view to be inside a NavigationView
. So, you might see a list row showing a disclosure indicator, but for it to appear disabled.
To fix the problem, wrap your view in a NavigationView
, like this:
NavigationView {
NavigationLink(destination: Text("Detail view")) {
Text("Show detail view")
}
}
SPONSORED In-app subscriptions are a pain. The code can be hard to write, hard to test, and full of edge cases. RevenueCat makes it straightforward and reliable so you can get back to building your app.
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.