ios - MKAnnotation Not Conform to Protocol -
i new ios programming , having problem extending locationa class conform mkannotation protocol.
the locationa class is:
import mapkit class locationa { let name: string let identifier: string let latitude: cllocationdegrees let longitude: cllocationdegrees init (name: string, identifier: string, latitude: cllocationdegrees, longitude: cllocationdegrees) { self.name = name self.identifier = identifier self.latitude = latitude self.longitude = longitude } }
the extended version is:
import mapkit extension locationa: mkannotation, nsobject { var coordinate: cllocationcoordinate2d { return cllocationcoordinate2d(latitude: latitude, longitude: longitude) } var title: string! { return identifier } var subtitle: string! { return name } }
it appears have implemented attributes required protocol still getting "not conform protocol" error. advice appreciated!
Comments
Post a Comment