codify implicit assumption about marker-providing delegate method precedence

This commit is contained in:
Justin R. Miller
2016-07-25 11:45:27 -07:00
parent 8cfaac11fd
commit 4e61b2e506

View File

@@ -639,6 +639,8 @@ static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXVie
return nil; // use default marker
}
NSAssert([annotation isKindOfClass:[MBXSpriteBackedAnnotation class]], @"Annotations should be sprite-backed.");
NSString *title = [(MGLPointAnnotation *)annotation title];
if (!title.length) return nil;
NSString *lastTwoCharacters = [title substringFromIndex:title.length - 2];