First you need to add MKMapViewDelegate to the class defenition.
mapView.delegate = self
Set the maps delegate to self in your viewDidLoad.
Setting the annotation
mapView.addOverlay(MKCircle(centerCoordinate: CLLocationCoordinate2D, radius: CLLocationDistance))
mapView rendererForOverlay should now be called in the mapViews delegate and there you get to draw it
func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOverlayRenderer {
if let overlay = overlay as? MKCircle {
let circleRenderer = MKCircleRenderer(circle: overlay)
circleRenderer.fillColor = UIColor.blueColor()
return circleRenderer
}
}
Also, you need to import MapKit for it all to compile
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…