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

[ios] Silence incompatible type warning for callout view #8608

Merged

Conversation

boundsj
Copy link
Contributor

@boundsj boundsj commented Mar 31, 2017

Continuation of #8420.
Fixes warning introduced in #8541

This silences a compatibility warning that was introduced in a previous refactor that changed the return type of the callout view for annotation delegate method. This also adds checks to ensure that the callout view provided by the delegate to the map view is of the correct type and conforms to the correct protocol.

This silences a compatibility warning that was introduced in a previous
refactor that changed the return type of the callout view for
annotation delegate method. This also adds checks to ensure that the
callout view provided by the delegate to the map view is of the correct
type and conforms to the correct protocol.
@boundsj boundsj added annotations Annotations on iOS and macOS or markers on Android build crash iOS Mapbox Maps SDK for iOS labels Mar 31, 2017
@boundsj boundsj added this to the ios-v3.5.1 milestone Mar 31, 2017
@boundsj boundsj self-assigned this Mar 31, 2017
@boundsj boundsj requested a review from 1ec5 March 31, 2017 20:32
calloutView = [self.delegate mapView:self calloutViewForAnnotation:annotation];
id providedCalloutView = [self.delegate mapView:self calloutViewForAnnotation:annotation];
if (providedCalloutView) {
NSAssert([providedCalloutView isKindOfClass:[UIView class]], @"callout view should be a kind of UIView");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an NSException, not an NSAssert. Now that the return value of -mapView:calloutViewForAnnotation: is no longer required to be a kind of UIView, returning something other than a UIView is a developer error, not an SDK error.

@@ -4,8 +4,6 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT

## 3.5.1

### Other changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@boundsj boundsj force-pushed the boundsj-cleanup-calloutview branch from 70597a0 to 6b02bc9 Compare April 3, 2017 21:54
@boundsj boundsj merged commit ff73371 into release-ios-v3.5.0-android-v5.0.0 Apr 4, 2017
@boundsj boundsj deleted the boundsj-cleanup-calloutview branch April 4, 2017 22:26
mappy-mobile pushed a commit to Mappy/mapbox-gl-native that referenced this pull request Apr 12, 2017
…or_merge

* release-ios-v3.5.0-android-v5.0.0: (31 commits)
  [qt] Renamed qt5 formula to qt
  macos-v0.4.1
  [ios] Update podspecs and changelog for v3.5.2
  [ios, macos] Guard against looking up annotation contexts MGLAnnotationTagNotFound (mapbox#8686)
  [ios] Update podspecs and changelog for v3.5.1
  [ios, macos] Hardened std::map usage in MGLMapVIew
  [ios] replaced link to select a feature example (mapbox#8651)
  [ios, macos] Rename Data-driven styling guide (mapbox#8627)
  [ios] assertion to check if an annotationTag > 0 (mapbox#8588)
  [ios, macos] Preserve symlinks when zipping framework
  [ios] Silence incompatible type warning for callout view (mapbox#8608)
  Release android v5.0.2 (mapbox#8629)
  [macos] Removed MGLUserTrackingMode from jazzy ToC
  [macos] Fixed broken images in DDS guide
  [core] cache binary shaders on Android
  [core] Extract and de-templatize several Program static methods
  macos-v0.4.0
  [ios, macos] Updated changelogs
  [ios] Replaced UIActionSheet, UIAlertView with UIAlertController
  [ios, macos] Copyedited data-driven styling guides
  ...
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 build crash iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants