更新到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