How to customise googlemap infoWindow using Swift 3
<p>Xcode version:
8.1</p>

<p>aim: </p>

<p>To replace native infoWindow by custom one</p>

<p>problem:</p>

<ol>
<li>When I click on the marker, my custom infoWindow did not show up but the native one,
Or</li>
<li>Thread 1:signal SIGABRT shown if I don't delete <code>myView.delegate = self</code>(See my code &amp; my research #21)</li>
</ol>

<p>what I have done:</p>

<ol>
<li>Created a .swift file and a .xib file with my custom infoWindow design.</li>
<li><p>Inserted mapView function into ViewController.swift:</p>

<pre><code>override func viewDidLoad() {
    super.viewDidLoad()
</code></pre>

<p>...</p>

<pre><code>    let camera = GMSCameraPosition.camera(withLatitude: latitude,
                                          longitude: Longitude, zoom: 16)
    let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
    mapView.delegate = self  // Thread 1:signal SIGABRT shown if i add this line
    mapView.isMyLocationEnabled = true
    self.view = mapView

    let marker = GMSMarker()
    marker.position = CLLocationCoordinate2DMake(latitude, Longitude)
    marker.title = "Me"
    marker.map = mapView
    mapView.selectedMarker = marker
}

func mapView(_ mapView: GMSMapView, markerInfoWindow marker: GMSMarker) -&gt; UIView? {
    let infoWindow = Bundle.main.loadNibNamed("CustomInfoWindow", owner: self.view, options: nil)!.first! as! CustomInfoWindow
    infoWindow.title.text = marker.title
    return infoWindow
}
</code></pre></li>
</ol>

<p>my research:</p>

<ol>
<li><a href="https://developers.google.com/maps/documentation/ios-sdk/marker" rel="nofollow noreferrer">https://developers.google.com/maps/documentation/ios-sdk/marker</a></li>
<li><a href="https://developers.google.com/maps/documentation/ios-sdk/reference/protocol_g_m_s_map_view_delegate-p" rel="nofollow noreferrer">https://developers.google.com/maps/documentation/ios-sdk/reference/protocol_g_m_s_map_view_delegate-p</a></li>
<li><a href="https://forums.developer.apple.com/thread/8462" rel="nofollow noreferrer">https://forums.developer.apple.com/thread/8462</a></li>
<li><a href="http://kevinxh.github.io/swift/custom-and-interactive-googlemaps-ios-sdk-infowindow.html" rel="nofollow noreferrer">http://kevinxh.github.io/swift/custom-and-interactive-googlemaps-ios-sdk-infowindow.html</a></li>
<li><a href="https://productforums.google.com/forum/#!topic/maps/w0sP7r3XAF4" rel="nofollow noreferrer">https://productforums.google.com/forum/#!topic/maps/w0sP7r3XAF4</a></li>
<li><a href="https://stackoverflow.com/questions/34488506/custom-infowindow-for-marker-google-maps-sdk-swift-2-0">Custom InfoWindow for marker Google Maps SDK, Swift 2.0</a></li>
<li><a href="https://www.youtube.com/watch?v=ILiBXYscsyY" rel="nofollow noreferrer">https://www.youtube.com/watch?v=ILiBXYscsyY</a></li>
<li><a href="https://stackoverflow.com/questions/15267183/custom-annotation-view-in-google-maps-sdk">Custom annotation view in Google Maps SDK</a> </li>
<li><a href="https://stackoverflow.com/questions/29462187/creating-custom-info-window-in-swift-with-the-google-maps-ios-sdk">Creating custom info window in swift with the Google maps iOS sdk?</a></li>
<li><a href="https://stackoverflow.com/questions/15816684/how-to-show-a-info-window-in-ios-google-maps-without-tapping-on-marker">How to show a Info window in iOS Google maps without tapping on Marker?</a></li>
<li><a href="https://stackoverflow.com/questions/25599791/custom-info-window-in-ios-google-maps-sdk">Custom info window in IOS google maps sdk</a></li>
<li><a href="https://stackoverflow.com/questions/33748622/ios-google-map-custom-infowindow-xib-error">IOS Google Map Custom InfoWindow Xib error</a></li>
<li><a href="https://stackoverflow.com/questions/30643740/google-maps-info-windows-resizing-based-on-the-internal-content">Google Maps Info window&#39;s resizing based on the internal content</a></li>
<li><a href="https://stackoverflow.com/questions/16746765/custom-info-window-for-google-maps">Custom Info Window for Google Maps</a></li>
<li><a href="https://stackoverflow.com/questions/22694740/custom-infowindows-issue-google-maps-ios-sdk">Custom InfoWindows issue -Google Maps iOS SDK-</a></li>
<li><a href="https://stackoverflow.com/questions/15177712/how-to-customize-the-infowindow-of-google-map-ios-sdk">How to customize the InfoWindow of google map iOS SDK?</a></li>
<li><a href="https://stackoverflow.com/questions/39927022/swift-3-google-maps-custom-infowindow">swift 3 google maps custom infowindow</a></li>
<li><a href="https://stackoverflow.com/questions/25513271/how-to-initialise-a-uiview-class-with-a-xib-file-in-swift-ios">How to initialise a UIView Class with a xib file in Swift, iOS</a></li>
<li><a href="https://github.com/ziyang0621/GoogleMaps-Swift/blob/master/GoogleMapSwift/ViewController.swift" rel="nofollow noreferrer">https://github.com/ziyang0621/GoogleMaps-Swift/blob/master/GoogleMapSwift/ViewController.swift</a></li>
<li><a href="https://github.com/ryanmaxwell/GoogleMapsCalloutView" rel="nofollow noreferrer">https://github.com/ryanmaxwell/GoogleMapsCalloutView</a></li>
<li><a href="https://stackoverflow.com/questions/32292330/implementing-custom-markerinfowindow-in-swift-not-working?rq=1">Implementing custom markerInfoWindow in swift not working</a></li>
<li><a href="https://codedump.io/share/hh7CO7c2j3PI/1/custom-infowindow-for-marker-google-maps-sdk-swift-20" rel="nofollow noreferrer">https://codedump.io/share/hh7CO7c2j3PI/1/custom-infowindow-for-marker-google-maps-sdk-swift-20</a></li>
</ol>