Swift 2 MKMapViewDelegate rendererForOverlay compiler warning
问题 I am trying to draw a polyline on a map in Swift 2. It all works well, but I get a compiler warning for this code: func mapView(mapView: MKMapView!, rendererForOverlay overlay: MKOverlay!) -> MKOverlayRenderer! { if overlay is MKPolyline { let polylineRenderer = MKPolylineRenderer(overlay: overlay) polylineRenderer.strokeColor = UIColor.redColor() polylineRenderer.lineWidth = 5 return polylineRenderer } return nil } This will give me a warning says that ' Result and parameters in mapView