PlaceSearchView
@MainActor
struct PlaceSearchViewextension PlaceSearchView : Sendable, View-
The type of view representing the body of this view.
When you create a custom view, Swift infers this type from your implementation of the required
View/body-swift.propertyproperty.Declaration
Swift
typealias Body = some View -
All
PlaceSearchContenttypes for the place search component.Declaration
Swift
@MainActor static let allContent: Set<PlaceSearchContent> -
The content and behavior of the view.
When you implement a custom view, you must implement a computed
bodyproperty to provide the content for your view. Return a view that’s composed of built-in views that SwiftUI provides, plus other composite views that you’ve already defined:struct MyView: View { var body: some View { Text("Hello, World!") } }For more information about composing views and a view hierarchy, see doc:Declaring-a-Custom-View.
Declaration
Swift
@MainActor @preconcurrency var body: some View { get } -
Creates a list of place search results.
Declaration
Swift
@MainActor init(orientation: PlaceViewOrientation = .vertical, request: Binding<PlaceSearchViewRequest>, configuration: PlaceSearchConfiguration)Parameters
orientationThe orientation of the view.
requestThe request for the view, which is used when fetching the place search results.
configurationThe configuration settings for the view.
Return Value
A view that displays a list of place search results.
-
Adds a callback to be called when the place results are loaded.
Declaration
Swift
@MainActor func onLoad(_ callback: @escaping ([Place]) -> Void) -> PlaceSearchViewParameters
callbackThe callback to be called when the place results are loaded.
Return Value
The
PlaceSearchViewwith the callback added. -
Adds a callback to be called when a place is selected.
Declaration
Swift
@MainActor func onPlaceSelected(_ callback: @escaping (Place) -> Void) -> PlaceSearchViewParameters
callbackThe callback to be called when a place is selected.
Return Value
The
PlaceSearchViewwith the callback added. -
Adds a callback to be called when the place search request fails.
Declaration
Swift
@MainActor func onRequestError(_ callback: @escaping (PlacesError) -> Void) -> PlaceSearchViewParameters
callbackThe callback to be called if the search request fails.
Return Value
The
PlaceSearchViewwith the callback added. -
A set of standard
PlaceSearchContenttypes for the place search component.Declaration
Swift
@MainActor static let standardContent: Set<PlaceSearchContent>