// MARK: - MapView Delegate
override func mapView(_ mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
var anView = mapView.dequeueReusableAnnotationView(withIdentifier: annotationReuseId)
if anView == nil {
anView = MKAnnotationView(annotation: annotation, reuseIdentifier: annotationReuseId)
} else {
anView!.annotation = annotation
}
anView!.image = UIImage(named: "Contactus_gatePin")
anView?.frame = CGRect(x: 0, y: 0, width: 53, height: 53)
anView!.backgroundColor = UIColor.clear
anView!.canShowCallout = false
return anView
}
override func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
return
}
我在Swift3中遇到此方法的错误。它在Swift2.2中工作
我无法将其转换为Swift 3.0
请帮忙
答案 0 :(得分:3)
在Swift 3中,viewForAnnotation
的{{1}}方法更改为此类。
MKMapViewDelegate
其他方法请检查optional func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
}
上的Apple Documentation。
答案 1 :(得分:0)
注释方法
using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)){
data = new byte[fs.Length];
fs.Read(data, 0, (int)fs.Length);