在swift中实现自定义markerInfoWindow不起作用

我一直在使用下面张贴的方法来显示自定义信息窗口,但是每当我运行它,只有默认的窗口(与标题/代码段)出现? 我为以下方法创build了xib和swift文件,并试图使用标准函数表示法(即mapView(mapView,markerInfoWindow:mapView.currentMarker))来实现它,但这不是编译(尝试使用和不使用明确的实现)任何想法?

谢谢,

雅各

func mapView(mapView: GMSMapView!, markerInfoWindow marker: GMSMarker!) -> UIView! { var infoWindow = NSBundle.mainBundle().loadNibNamed("InfoWindow", owner: self, options: nil).first! as InfoWindow infoWindow.label.text = "\(marker.position.latitude) \(marker.position.longitude)" return infoWindow } 

InfoWindow的内容:

 class InfoWindow: UIView { @IBOutlet var label: UILabel! /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. override func drawRect(rect: CGRect) { // Drawing code } */ }