Last night I upgraded to Swift 1.2, and I got an error that I really can't understand. In previous versions of Xcode and Swift, this code worked fine.
class PointAnnotation : NSObject, MKAnnotation {
var coordinate: CLLocationCoordinate2D
var title: String
var subtitle: String
var point: Point
var image: UIImage
var md: String
init(point: Point) {
self.coordinate = point.coordinate
self.title = point.title
self.subtitle = point.teaser
self.image = UIImage(named: "annotation.png")!
self.point = point
self.md = point.content
}
}
In line 3, it becomes difficult for me to understand the error.
Objective-C method 'setCoordinate:' provided by the setter for 'coordinate' conflicts with the optional requirement method 'setCoordinate' in protocol 'MKAnnotation'I tried to change the names of variables, etc., but did not help. Does anyone know how to fix this?
The class is intended for annotations on my map.
source
share