How does this code snippet work? Maybe I am missing a fundamental point here but I always thought that constants are well, constant and the only properties you could modify were variables. How does this compile?
extension MKPointAnnotation {
static var example: MKPointAnnotation {
let annotation = MKPointAnnotation()
annotation.title = "Current Stay"
annotation.subtitle = "Temporary Maryland Abode"
annotation.coordinate = CLLocationCoordinate2D(latitude: 20, longitude: -70)
return annotation
}
}