Search code examples
iosswiftgoogle-mapsgesturetap

How to detect when tap on google map iOS Swift?


I want to check and detect when tap on map marker or anything. Do any delegates exist for this case with google maps in iOS Swift 4?

Thanks.


Solution

  •  func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) {
     //Write your code here...
     }
    

    if the delegate function is not called then set the mapview delegate in viewDidAppear() method or in LocationManager didUpdateLocations() method.