I have a class:
我有一个类:
class MyAnnotion: NSObject, MKAnnotation {
let title: String?
let subtitle: String?
let item: MyCustomItem
let coordinate: CLLocationCoordinate2D
init(customItem: MyCustomItem, currentLocation: CLLocation) {
coordinate = item.coordinate
pageId = "\(item.pageId)"
title = "\(item.title)"
item = myCustomItem
}
//TODO: Even though in mapView viewFor: the annotation is a WikiAnnotation, it wont recognize any custom function defined here
func imageUrl() -> String? {
guard let url = item.imageUrl else {
return nil
}
return url
}
}
class MyAnnotion: NS