A modifier that provides an autocomplete component for the user to select a place.
Whenshowis set to true, the user will be brought to a fullscreen view where they can select
a place. As the user types, the widget returns suggestions for places such as businesses,
addresses, and points of interest. When the user selects a place, the widget calls theonSelectionhandler with the selected place, and closes the fullscreen view.
A modifier that provides an autocomplete component for the user to select a place.
Whenshowis set to true, the user will be brought to a fullscreen view where they can select
a place. As the user types, the component returns suggestions for places such as businesses,
addresses, and points of interest. When the user selects a place, the component calls theonSelectionhandler with the selected place, and closes the fullscreen view.
The filter to apply to the autocomplete requests from the component.
uiCustomization
The UI customization to apply to the component.
initialQuery
The initial query to use for the component.
sessionToken
TheAutocompleteSessionTokento associate requests with a billing session.
A unique session token should be provided each time the component is shown. If no session
token is provided, one will be created internally and returned in theonSelectionhandler.
show
The binding for whether the component is shown.
onSelection
The closure to run when a place is selected.
onError
The closure to run when an error occurs.
Return Value
A modified view that displays the component whenshowis true.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-27 UTC."],[],[],null,["# GooglePlacesSwift Framework Reference\n\nView\n====\n\n extension View\n\n- `\n ``\n ``\n `\n\n ### [basicPlaceAutocomplete(filter:uiCustomization:initialQuery:show:onSelection:onError:)](#/s:7SwiftUI4ViewP012GooglePlacesA0E22basicPlaceAutocomplete6filter15uiCustomization12initialQuery4show11onSelection0O5ErrorQrAD0H6FilterVSg_AD0H15UICustomizationVSSAA7BindingVySbGyAD0G0VcyAD0eQ0OctF)\n\n `\n ` \n A modifier that provides an autocomplete component for the user to select a place.\n\n When `show` is set to true, the user will be brought to a fullscreen view where they can select\n a place. As the user types, the widget returns suggestions for places such as businesses,\n addresses, and points of interest. When the user selects a place, the widget calls the\n `onSelection` handler with the selected place, and closes the fullscreen view. \n\n #### Declaration\n\n Swift \n\n @MainActor\n func basicPlaceAutocomplete(filter: ../Structs/AutocompleteFilter.html? = nil, uiCustomization: ../Structs/AutocompleteUICustomization.html = ../Structs/AutocompleteUICustomization.html(), initialQuery: String = \"\", show: Binding\u003cBool\u003e, onSelection: @escaping (../Structs/Place.html) -\u003e Void, onError: @escaping (../Enums/PlacesError.html) -\u003e Void) -\u003e some View\n\n #### Parameters\n\n |-------------------------|----------------------------------------------------------------------|\n | ` `*filter*` ` | The filter to apply to the autocomplete requests from the component. |\n | ` `*uiCustomization*` ` | The UI customization to apply to the component. |\n | ` `*initialQuery*` ` | The initial query to use for the component. |\n | ` `*show*` ` | The binding for whether the component is shown. |\n | ` `*onSelection*` ` | The closure to run when a place is selected. |\n | ` `*onError*` ` | The closure to run when an error occurs. |\n\n #### Return Value\n\n A modified view that displays the component when `show` is true.\n- `\n ``\n ``\n `\n\n ### [placeAutocomplete(filter:uiCustomization:initialQuery:sessionToken:show:onSelection:onError:)](#/s:7SwiftUI4ViewP012GooglePlacesA0E17placeAutocomplete6filter15uiCustomization12initialQuery12sessionToken4show11onSelection0P5ErrorQrAD0G6FilterVSg_AD0G15UICustomizationVSSAD0g7SessionN0VSgAA7BindingVySbGyAD0G15PlaceSuggestionV_AStcyAD0eR0OctF)\n\n `\n ` \n A modifier that provides an autocomplete component for the user to select a place.\n\n When `show` is set to true, the user will be brought to a fullscreen view where they can select\n a place. As the user types, the component returns suggestions for places such as businesses,\n addresses, and points of interest. When the user selects a place, the component calls the\n `onSelection` handler with the selected place, and closes the fullscreen view. \n\n #### Declaration\n\n Swift \n\n @MainActor\n func placeAutocomplete(filter: ../Structs/AutocompleteFilter.html? = nil, uiCustomization: ../Structs/AutocompleteUICustomization.html = ../Structs/AutocompleteUICustomization.html(), initialQuery: String = \"\", sessionToken: ../Structs/AutocompleteSessionToken.html? = nil, show: Binding\u003cBool\u003e, onSelection: @escaping (../Structs/AutocompletePlaceSuggestion.html, ../Structs/AutocompleteSessionToken.html) -\u003e Void, onError: @escaping (../Enums/PlacesError.html) -\u003e Void) -\u003e some View\n\n #### Parameters\n\n |-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*filter*` ` | The filter to apply to the autocomplete requests from the component. |\n | ` `*uiCustomization*` ` | The UI customization to apply to the component. |\n | ` `*initialQuery*` ` | The initial query to use for the component. |\n | ` `*sessionToken*` ` | The [AutocompleteSessionToken](../Structs/AutocompleteSessionToken.html) to associate requests with a billing session. A unique session token should be provided each time the component is shown. If no session token is provided, one will be created internally and returned in the `onSelection` handler. |\n | ` `*show*` ` | The binding for whether the component is shown. |\n | ` `*onSelection*` ` | The closure to run when a place is selected. |\n | ` `*onError*` ` | The closure to run when an error occurs. |\n\n #### Return Value\n\n A modified view that displays the component when `show` is true."]]