I am using a custom point annotation that includes an image. I am getting several errors such as "Computed property must have an explicit type" and "Variable with getter/setter cannot have an initial value" with the var annotation line. If I fix one another pops up. Does anyone know how to achieve this in Swift 3?
func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) {
let eventPageViewController:EventPageViewController = storyboard?.instantiateViewController(withIdentifier: "EventPage") as! EventPageViewController
var annotation = view.annotation as? CustomPointAnnotation{
eventPageViewController.photo = annotation?.imageName
}
self.present(eventPageViewController, animated: true, completion: nil)
}
Here is the Custom Point Class:
class CustomPointAnnotation: MKPointAnnotation {
var imageName: UIImage!
}