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

[ios] Don't crash on tap when an AnnotationVIew doesn’t have an annotation #8755

Closed
wants to merge 1 commit into from

Conversation

JesseCrocker
Copy link
Contributor

Fixes #8754
MGLAnnotationView.annotation is marked as nullable, and i think there is a good case to be made that custom annotations views should be able to set their annotation to nil when removed from the map, so enforcing non-null here seems like a bug, and one that there is no easy way to workaround because it is throwing an exception in a call to UIGestureRecognizerDelegate.

@boundsj boundsj added this to the ios-v3.6.0 milestone Apr 18, 2017
@boundsj boundsj added annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS labels Apr 18, 2017
@boundsj boundsj requested review from boundsj and fabian-guerra May 10, 2017 18:55
@boundsj boundsj self-assigned this May 15, 2017
@boundsj
Copy link
Contributor

boundsj commented May 17, 2017

Thanks so much! I'm closing for the reasons stated in #8754 (comment)

The PR #8755 works around a bug caused by this issue but also removes an otherwise valid sanity check. That is, annotation views that are not visible because they are in the reuse queue or removed should have a nil annotation property. The other exceptions that were added as a result of #8139 (review) are all similarly valid. I think we should close #8755 and find another solution.

To that end, I created #9025 to close this issue. I also created #9029 to add an initializer that takes an annotation to facilitate customization of the view based on the annotation model properties.

Let's continue to track this in #8754 and the PRs listed there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants