struct NavigationBarDrawerDisplayMode
A structure that defines the display behavior of a search field when in the navigation bar drawer.
Availability 有効性
Technology
struct SearchFieldPlacement
A preferred placement may be given to View/searchable(text:
modifier.
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, the requested placement may not be able to be fulfilled.
struct NavigationBarDrawerDisplayMode
static let automatic: SearchFieldPlacement
static let navigationBarDrawer : SearchFieldPlacement
static let sidebar: SearchFieldPlacement
static let toolbar: SearchFieldPlacement
static func navigationBarDrawer (displayMode : SearchFieldPlacement .NavigationBarDrawerDisplayMode ) -> SearchFieldPlacement
func searchable(text: Binding<String>, placement: SearchFieldPlacement , prompt: Text?) -> some View
func searchable(text: Binding<String>, placement: SearchFieldPlacement , prompt: LocalizedStringKey ) -> some View
func searchable<S>(text: Binding<String>, placement: SearchFieldPlacement , prompt: S) -> some View
func searchable<S>(text: Binding<String>, placement: SearchFieldPlacement , prompt: Text?, suggestions: () -> S) -> some View
func searchable<S>(text: Binding<String>, placement: SearchFieldPlacement , prompt: LocalizedStringKey , suggestions: () -> S) -> some View
func searchable<V, S>(text: Binding<String>, placement: SearchFieldPlacement , prompt: S, suggestions: () -> V) -> some View
func searchCompletion (String) -> some View