When I try to conform MKAnnotation
protocol it throw error my class does not conform to protocol MKAnnotation
. I am using the following code
import MapKit
import Foundation
class MyAnnotation: NSObject, MKAnnotation
{
}
The same thing is possible with Objective-C.
You need to implement following required property in the calls:
class MyAnnotation: NSObject, MKAnnotation {
var myCoordinate: CLLocationCoordinate2D
init(myCoordinate: CLLocationCoordinate2D) {
self.myCoordinate = myCoordinate
}
var coordinate: CLLocationCoordinate2D {
return myCoordinate
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With