SwiftUI (and maybe visionOS specific?) question: how do you show a search bar in the middle of the navigation bar, like Apple does in a bunch of apps?
Many of Apple’s own visionOS apps, like Music, Safari, and Apple TV, have a handy search bar front and center on the window so you can easily search through your content. Oddly, as of visionOS 1.1, replicating this visually as a developer using SwiftUI or UIKit is not particularly easy due to lack of a direct API, but it’s still totally possible, so let’s explore how. First let’s get a few ideas out of the way to maybe save you some time.