7.4 C
Canberra
Sunday, April 19, 2026

swift – Unusual empty circle in Google Locations autocomplete for iOS 26


As Google’s documentation exhibits zero API to customise or conceal the icon
Google’s official docs for GMSAutocompleteViewController listing all customizable properties:

tableCellBackgroundColor

tableCellSeparatorColor

primaryTextColor

secondaryTextColor

primaryTextHighlightColor

tintColor

searchBar

No, you can not take away the circle from the default Google autocomplete controller. Solely workaround is to keep away from utilizing that controller.

Google gives two APIs:

1. Predictions API

2. Place Particulars API

Create Autocomplete ViewModel

class AutocompleteViewModel: ObservableObject {
    @Revealed var question = ""
    @Revealed var predictions: [GMSAutocompletePrediction] = []

    personal let token = GMSAutocompleteSessionToken()

    func search() {
        GMSPlacesClient.shared().findAutocompletePredictions(
            fromQuery: question,
            filter: nil,
            sessionToken: token
        ) { outcomes, error in
            DispatchQueue.important.async {
                self.predictions = outcomes ?? []
            }
        }
    }

    func fetchPlace(_ prediction: GMSAutocompletePrediction,
                    completion: @escaping (GMSPlace?) -> Void) {
        let fields: GMSPlaceField = [.name, .coordinate, .formattedAddress]
        GMSPlacesClient.shared().fetchPlace(
            fromPlaceID: prediction.placeID,
            placeFields: fields,
            sessionToken: token
        ) { place, error in
            completion(place)
        }
    }
}

Create customized picker

struct CustomPlacePicker: View {
    @StateObject personal var vm = AutocompleteViewModel()
    var onSelect: (GMSPlace) -> Void

    var physique: some View {
        VStack {
            TextField("Search location", textual content: $vm.question)
                .padding()
                .background(.ultraThinMaterial)
                .cornerRadius(12)
                .onChange(of: vm.question) { _ in vm.search() }

            Listing(vm.predictions, id: .placeID) { prediction in
                VStack(alignment: .main) {
                    Textual content(prediction.attributedPrimaryText.string)
                        .font(.headline)
                    Textual content(prediction.attributedSecondaryText?.string ?? "")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .onTapGesture {
                    vm.fetchPlace(prediction) { place in
                        if let place = place { onSelect(place) }
                    }
                }
            }
        }
        .padding()
    }
}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles