更新到Swift 3后很多地方出现这个错误我改变了这个地方?和!但另一个错误出现(类型[字符串:AnyObject]?有没有标名成员)对成员'下标'的模糊引用Swift 3
func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutableRawPointer) {
if !didFindMyLocation {
let myLocation: CLLocation = change? [NSKeyValueChangeNewKey] as! CLLocation //Ambiguous reference to member 'subscript'
viewMap.camera = GMSCameraPosition.camera(withTarget: myLocation.coordinate, zoom: 10.0)
viewMap.settings.myLocationButton = true
didFindMyLocation = true
}
}
的可能的复制[使用 - observeValueForKeyPath:ofObject:变化:上下文:在夫特3](http://stackoverflow.com/questions/39136706/using-observevalueforkeypathofobjectchangecontext -in-swift-3) – vadian