advanced patterns of SwiftUI's NavigationLink When Embedded in a ScrollView on iPhone 12
I'm working on a project and hit a roadblock. I'm integrating two systems and I'm sure I'm missing something obvious here, but I'm upgrading from an older version and I'm working with an scenario where a `NavigationLink` embedded within a `ScrollView` behaves inconsistently on my iPhone 12... The link is supposed to navigate to a detail view when tapped, but sometimes it just doesn't respond at all, and other times it navigates to the detail view but the transition feels very sluggish. Here's a minimal example of the implementation: ```swift struct ContentView: View { var body: some View { NavigationView { ScrollView { VStack { ForEach(0..<20) { index in NavigationLink(destination: DetailView(index: index)) { Text("Item \(index)") .padding() .background(Color.blue) .cornerRadius(8) } } } .padding() } .navigationTitle("Items") } } } struct DetailView: View { let index: Int var body: some View { Text("Detail for Item \(index)") .font(.largeTitle) } } ``` I've tried wrapping the `ScrollView` in a `NavigationView`, and although it works as intended when the app is first launched, after scrolling down and tapping a `NavigationLink`, it sometimes doesn't trigger the navigation. I also experimented with different `ScrollView` options (like using `ScrollViewReader`), but nothing seems to help. I've checked for any updates to Xcode and Swift, and I am currently using Xcode 14.0 and targeting iOS 16.0. I also attempted to profile the app using Instruments to check for performance bottlenecks, but nothing stood out as problematic. Does anyone have insights into why this might be happening? Any suggestions on best practices for using `NavigationLink` within `ScrollView`? Thanks! For reference, this is a production mobile app. Hoping someone can shed some light on this. The project is a desktop app built with Swift. Thanks for any help you can provide! I'm working in a macOS environment. I'm developing on Ubuntu 22.04 with Swift. Am I missing something obvious? I appreciate any insights!