Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Assert if -mapView:symbolNameForAnnotation: is implemented
Browse files Browse the repository at this point in the history
Fixes #1851.
  • Loading branch information
1ec5 authored and incanus committed Jul 8, 2015
1 parent a67e802 commit 49fe6df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions platform/ios/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,14 @@ - (void)setDelegate:(nullable id<MGLMapViewDelegate>)delegate
if (_delegate == delegate) return;

_delegate = delegate;

if ([delegate respondsToSelector:@selector(mapView:symbolNameForAnnotation:)])
{
[NSException raise:@"Method unavailable" format:
@"-mapView:symbolNameForAnnotation: has been removed from the MGLMapViewDelegate protocol, but %@ still implements it. "
@"Implement -[%@ mapView:imageForAnnotation:] instead.",
NSStringFromClass([delegate class]), NSStringFromClass([delegate class])];
}
}

#pragma mark - Layout -
Expand Down

0 comments on commit 49fe6df

Please sign in to comment.