diff options
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/src/MGLMapView.h | 8 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 2 | ||||
-rw-r--r-- | platform/ios/src/UIView+MGLAdditions.h | 2 | ||||
-rwxr-xr-x | platform/ios/vendor/SMCalloutView/SMCalloutView.m | 9 |
4 files changed, 13 insertions, 8 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 607a197840..2423d62ee1 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -1130,7 +1130,7 @@ MGL_EXPORT `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ -- (MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets; +- (nullable MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets; /** Returns the camera that best fits the given coordinate bounds, with the specified camera, @@ -1150,7 +1150,7 @@ MGL_EXPORT `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ -- (MGLMapCamera *)camera:(MGLMapCamera *)camera fittingCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets; +- (nullable MGLMapCamera *)camera:(MGLMapCamera *)camera fittingCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets; /** Returns the camera that best fits the given shape, with the specified camera, @@ -1169,7 +1169,7 @@ MGL_EXPORT `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ -- (MGLMapCamera *)camera:(MGLMapCamera *)camera fittingShape:(MGLShape *)shape edgePadding:(UIEdgeInsets)insets; +- (nullable MGLMapCamera *)camera:(MGLMapCamera *)camera fittingShape:(MGLShape *)shape edgePadding:(UIEdgeInsets)insets; /** Returns the camera that best fits the given shape, with the specified direction, @@ -1187,7 +1187,7 @@ MGL_EXPORT `UIApplicationWillTerminateNotification`; you may receive a `nil` return value depending on the order of notification delivery. */ -- (MGLMapCamera *)cameraThatFitsShape:(MGLShape *)shape direction:(CLLocationDirection)direction edgePadding:(UIEdgeInsets)insets; +- (nullable MGLMapCamera *)cameraThatFitsShape:(MGLShape *)shape direction:(CLLocationDirection)direction edgePadding:(UIEdgeInsets)insets; /** Returns the point in this view’s coordinate system on which to "anchor" in diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index cadf5be3fd..7365c02c29 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -2478,7 +2478,7 @@ public: }]; [attributionController addAction:telemetryAction]; - NSString *cancelTitle = NSLocalizedStringWithDefaultValue(@"CANCEL", nil, nil, @"Cancel", @""); + NSString *cancelTitle = NSLocalizedStringWithDefaultValue(@"CANCEL", nil, nil, @"Cancel", @"Cancel"); UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleCancel handler:NULL]; diff --git a/platform/ios/src/UIView+MGLAdditions.h b/platform/ios/src/UIView+MGLAdditions.h index 85fea31ad2..ef074215b3 100644 --- a/platform/ios/src/UIView+MGLAdditions.h +++ b/platform/ios/src/UIView+MGLAdditions.h @@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN @interface UIView (MGLAdditions) -- (UIViewController *)mgl_viewControllerForLayoutGuides; +- (nullable UIViewController *)mgl_viewControllerForLayoutGuides; - (NSLayoutYAxisAnchor *)mgl_safeTopAnchor; diff --git a/platform/ios/vendor/SMCalloutView/SMCalloutView.m b/platform/ios/vendor/SMCalloutView/SMCalloutView.m index 66a7b5a7a7..0520ba08a5 100755 --- a/platform/ios/vendor/SMCalloutView/SMCalloutView.m +++ b/platform/ios/vendor/SMCalloutView/SMCalloutView.m @@ -554,13 +554,18 @@ NSTimeInterval const kMGLSMCalloutViewRepositionDelayForUIScrollView = 1.0/3.0; stretch.toValue = presenting ? @1.0 : @0.0; animation = stretch; } - + + NSAssert(animation, @"There should be an animation"); + // CAAnimation is KVC compliant, so we can store whether we're presenting for lookup in our delegate methods [animation setValue:@(presenting) forKey:@"presenting"]; animation.fillMode = kCAFillModeForwards; animation.removedOnCompletion = NO; - return animation; + + // Cast as non-null to mute static analysis warning as documented at + // https://clang-analyzer.llvm.org/faq.html#decide_nullability + return (CAAnimation * _Nonnull)animation; } - (void)layoutSubviews { |