So I am using an Objective-C library that makes use of MKMapView
.
So there is a class:
@interface BSWeatherMapView : MKMapView
/** The receiver’s delegate. */
@property (nonatomic, weak) id<BSWeatherMapViewDelegate> delegate;
Its protocol is defined with this method:
@protocol BSWeatherMapViewDelegate<MKMapViewDelegate>
@optional
- (MKAnnotationView *)mapView:(BSWeatherMapView *)mapView viewForAnnotation:(id<MKAnnotation >)annotation;
My swift class has an extension doing the following:
extension ViewController : BSWeatherMapViewDelegate {
func mapView(mapView: BSWeatherMapView!, viewForAnnotation annotation: AnyObject) -> MKAnnotationView! {}
}
When I do this I get the following error:
Objective-C method mapView:viewForAnnotation:
provided by method mapView(_:viewForAnnotation:)
conflicts with optional requirement method mapView(_:viewForAnnotation:)
in protocol MKMapViewDelegate
I have no clue how to get past this... anyone?
Thanks,