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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -