SearchFieldPlacement
The placement of a search field in a view hierarchy.
Declaration
struct SearchFieldPlacementMentioned in
Overview
You can give a preferred placement to any of the searchable modifiers, like searchable(text:placement:prompt:):
var body: some View {
NavigationView {
PrimaryView()
SecondaryView()
Text("Select a primary and secondary item")
}
.searchable(text: $text, placement: .sidebar)
}Depending on the containing view hierachy, SwiftUI might not be able to fulfill your request.