In Swift, you need to implement all the optional protocol variables and methods in order to conform to the protocol. Right now, your class is empty, which means that now it does not comply with the MKAnnotation protocol. If you look at the MKAnnotation ad:
protocol MKAnnotation : NSObjectProtocol { // Center latitude and longitude of the annotation view. // The implementation of this property must be KVO compliant. var coordinate: CLLocationCoordinate2D { get } // Title and subtitle for use by selection UI. optional var title: String! { get } optional var subtitle: String! { get } // Called as a result of dragging an annotation view. @availability(OSX, introduced=10.9) optional func setCoordinate(newCoordinate: CLLocationCoordinate2D) }
you can see that if you implement at least the coordinate variable, then you comply with the protocol.
source share