title: Google Places Autocomplete in UItextField using Swift
body: <p>I want to add the Google places autocomplete search suggestion just below UITextfield and I want latitude and longitude of the user. There will be two textfields i.e. pickup location and drop off location. Picture is attached for example. I have tried code but it did not show just below the uitextfield.</p>
  
  <pre><code>import UIKit
  import GoogleMaps
  import GooglePlaces
  import GooglePlacePicker
  
  class ViewController: UIViewController, UITextFieldDelegate {
  
  @IBOutlet weak var pickupLocation: UITextField!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      self.pickupLocation.delegate = self
  }
  func textFieldDidBeginEditing(_ textField: UITextField) {
      let acController = GMSAutocompleteViewController()
      acController.delegate = self
      self.present(acController, animated: true, completion: nil)
  }
  }
  
  extension ViewController: GMSAutocompleteViewControllerDelegate {
  
  // Handle the user's selection.
  func viewController(_ viewController: GMSAutocompleteViewController, didAutocompleteWith place: GMSPlace) {
      print("Place name: \(place.name)")
      print("Place address: \(String(describing: place.formattedAddress))")
      print("Place attributions: \(String(describing: place.attributions))")
      dismiss(animated: true, completion: nil)
  }
  
  func viewController(_ viewController: GMSAutocompleteViewController, didFailAutocompleteWithError error: Error) {
      // TODO: handle the error.
      print("Error: ", error.localizedDescription)
  }
  
  // User canceled the operation.
  func wasCancelled(_ viewController: GMSAutocompleteViewController) {
      dismiss(animated: true, completion: nil)
  }
  </code></pre>
  
  <p>The sample picture is below attached
   <a href="https://i.stack.imgur.com/cH2no.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cH2no.png" alt="enter image description here"></a></p>