Reputation: 685
I added the autocomplete UI control "Add a full-screen control" from
https://developers.google.com/places/ios-api/autocomplete
and use the below code for presenting the Autocomplete view controller when the button is pressed.
let autocompleteController = GMSAutocompleteViewController()
autocompleteController.delegate = self
present(autocompleteController, animated: true, completion: nil)
The below images show what I have got. Everything is working, But cancel button is only shown when I click there.
Upvotes: 1
Views: 409
Reputation: 36
if you are using following type code then you are face this problem
UIBarButtonItem.appearance().setTitleTextAttributes([
NSAttributedStringKey.foregroundColor: UIColor.white,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 0.1)
], for: UIControlState.normal)
Solution - Change UIControlState from UIControlState.normal
UIBarButtonItem.appearance().setTitleTextAttributes([
NSAttributedStringKey.foregroundColor : UIColor.white,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 0.1)
], for: UIControlState.application)
Upvotes: 2