run into an issue of SWIFT UI with toolbarItem (navigationBarItem for iOS) and it turns out I have the accessibility (label:) in my item and that cause the swiftUI to have UIConstraint breaking issues. this could cause the UI to never navigate so no longer useful.
try to put the following control in the toolbar, you might need to add some principle toolbar title item and other toolbar item.
the problem can be fixed by removing the accessibility line.
try to put the following control in the toolbar, you might need to add some principle toolbar title item and other toolbar item.
the problem can be fixed by removing the accessibility line.
Code Block var purchaseButtonView: some View{ NavigationLink( destination: PurchaseView(), label: { Image(systemName: entitlement.localEmerald ? "hare.fill" : "cart.fill") .foregroundColor( entitlement.localEmerald ? Color.yellow : products.items.count == 0 ? Color.gray : Color.blue ) accessibility(label: Text("purchase")) //----> this accessibilityLabel will cause the swiftUI to no longer navigate }) .disabled(products.items.count == 0 ) }