summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2019-05-02 14:08:48 -0400
committerGitHub <noreply@github.com>2019-05-02 14:08:48 -0400
commitf7915fdc51f4924df2e2630b64908938ffa49830 (patch)
tree2364053e375a5091392096d3dd9e25086b66e847
parentc611d085b3dd478466f05eab24c442d53fef84ec (diff)
downloadqtlocation-mapboxgl-f7915fdc51f4924df2e2630b64908938ffa49830.tar.gz
[ios] Static analysis fix tweaks - part 2 (#14572)
-rw-r--r--platform/darwin/include/mbgl/storage/reachability.h2
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.h2
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.mm3
-rw-r--r--platform/darwin/src/reachability.m22
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj6
-rw-r--r--platform/ios/resources/Base.lproj/Localizable.strings4
-rw-r--r--platform/ios/resources/bg.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/ca.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/cs.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/da.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/de.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/es.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/fr.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/gl.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/he.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/hu.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/ja.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/ko.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/lt.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/pt-BR.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/pt-PT.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/ru.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/sv.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/uk.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/vi.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/zh-Hans.lproj/Localizable.strings2
-rw-r--r--platform/ios/resources/zh-Hant.lproj/Localizable.strings2
-rw-r--r--platform/ios/src/MGLMapView.h8
-rw-r--r--platform/ios/src/MGLMapView.mm14
-rwxr-xr-xplatform/ios/vendor/SMCalloutView/SMCalloutView.m84
30 files changed, 102 insertions, 85 deletions
diff --git a/platform/darwin/include/mbgl/storage/reachability.h b/platform/darwin/include/mbgl/storage/reachability.h
index e38c9b1e20..e7a00008be 100644
--- a/platform/darwin/include/mbgl/storage/reachability.h
+++ b/platform/darwin/include/mbgl/storage/reachability.h
@@ -69,8 +69,6 @@ typedef void (^NetworkUnreachable)(MGLReachability * reachability);
+(instancetype)reachabilityWithAddress:(void *)hostAddress;
+(instancetype)reachabilityForLocalWiFi;
--(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref;
-
-(BOOL)startNotifier;
-(void)stopNotifier;
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.h b/platform/darwin/src/NSExpression+MGLAdditions.h
index 9ef6623068..a19ec1af2e 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.h
+++ b/platform/darwin/src/NSExpression+MGLAdditions.h
@@ -190,7 +190,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
@return An initialized expression equivalent to `object`, suitable for use as
the value of a style layer attribute.
*/
-+ (instancetype)expressionWithMGLJSONObject:(nullable id)object NS_SWIFT_NAME(init(mglJSONObject:));
++ (instancetype)expressionWithMGLJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:));
/**
An equivalent Foundation object that can be serialized as JSON.
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm
index 026d8bec02..b3060b5787 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.mm
+++ b/platform/darwin/src/NSExpression+MGLAdditions.mm
@@ -792,6 +792,9 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
} else if ([curveType isEqualToString:@"cubic-bezier"]) {
curveParameters = @[@"literal", [interpolationOptions subarrayWithRange:NSMakeRange(1, 4)]];
}
+ else {
+ curveParameters = [NSNull null];
+ }
NSExpression *curveParameterExpression = [NSExpression expressionWithMGLJSONObject:curveParameters];
argumentObjects = [argumentObjects subarrayWithRange:NSMakeRange(1, argumentObjects.count - 1)];
NSExpression *inputExpression = [NSExpression expressionWithMGLJSONObject:argumentObjects.firstObject];
diff --git a/platform/darwin/src/reachability.m b/platform/darwin/src/reachability.m
index 2030e7ef71..737145a8a7 100644
--- a/platform/darwin/src/reachability.m
+++ b/platform/darwin/src/reachability.m
@@ -100,6 +100,8 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
{
id reachability = [[self alloc] initWithReachabilityRef:ref];
+ CFRelease(ref);
+
return reachability;
}
@@ -113,6 +115,8 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
{
id reachability = [[self alloc] initWithReachabilityRef:ref];
+ CFRelease(ref);
+
return reachability;
}
@@ -149,13 +153,13 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
self = [super init];
if (self != nil)
{
- self.reachableOnWWAN = YES;
- self.reachabilityRef = ref;
+ _reachableOnWWAN = YES;
+ _reachabilityRef = CFRetain(ref);
// We need to create a serial queue.
// We allocate this once for the lifetime of the notifier.
- self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL);
+ _reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL);
}
return self;
@@ -165,15 +169,15 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea
{
[self stopNotifier];
- if(self.reachabilityRef)
+ if(_reachabilityRef)
{
- CFRelease(self.reachabilityRef);
- self.reachabilityRef = nil;
+ CFRelease(_reachabilityRef);
+ _reachabilityRef = nil;
}
- self.reachableBlock = nil;
- self.unreachableBlock = nil;
- self.reachabilitySerialQueue = nil;
+ _reachableBlock = nil;
+ _unreachableBlock = nil;
+ _reachabilitySerialQueue = nil;
}
#pragma mark - Notifier Methods
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index be0c2388f5..c1b0b875a2 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -3749,6 +3749,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -4094,6 +4096,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -4106,6 +4110,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
diff --git a/platform/ios/resources/Base.lproj/Localizable.strings b/platform/ios/resources/Base.lproj/Localizable.strings
index d660cb6ddd..e1bfc0b256 100644
--- a/platform/ios/resources/Base.lproj/Localizable.strings
+++ b/platform/ios/resources/Base.lproj/Localizable.strings
@@ -1,7 +1,7 @@
/* Accessibility hint */
"ANNOTATION_A11Y_HINT" = "Shows more info";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Cancel";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
@@ -20,7 +20,7 @@
"DESIGNABLE" = "To display a Mapbox-hosted map here, set %1$@ to your access token in %2$@\n\nFor detailed instructions, see:";
/* Setup documentation URL display string; keep as short as possible */
-"FIRST_STEPS_URL" = "mapbox.com/help/first-steps-ios-sdk";
+"FIRST_STEPS_URL" = "docs.mapbox.com/help/tutorials/first-steps-ios-sdk";
/* Accessibility hint */
"INFO_A11Y_HINT" = "Shows credits, a feedback form, and more";
diff --git a/platform/ios/resources/bg.lproj/Localizable.strings b/platform/ios/resources/bg.lproj/Localizable.strings
index 777f4fe563..9b77111d30 100644
--- a/platform/ios/resources/bg.lproj/Localizable.strings
+++ b/platform/ios/resources/bg.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Статус код %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Отказ";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/ca.lproj/Localizable.strings b/platform/ios/resources/ca.lproj/Localizable.strings
index a5c06f739e..41996b191f 100644
--- a/platform/ios/resources/ca.lproj/Localizable.strings
+++ b/platform/ios/resources/ca.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "El codi d’estat era %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Cancel·lar";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/cs.lproj/Localizable.strings b/platform/ios/resources/cs.lproj/Localizable.strings
index d660cb6ddd..587e67a054 100644
--- a/platform/ios/resources/cs.lproj/Localizable.strings
+++ b/platform/ios/resources/cs.lproj/Localizable.strings
@@ -1,7 +1,7 @@
/* Accessibility hint */
"ANNOTATION_A11Y_HINT" = "Shows more info";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Cancel";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/da.lproj/Localizable.strings b/platform/ios/resources/da.lproj/Localizable.strings
index dd384b21fc..f1af0c39db 100644
--- a/platform/ios/resources/da.lproj/Localizable.strings
+++ b/platform/ios/resources/da.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Status koden var %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Fortryd";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/de.lproj/Localizable.strings b/platform/ios/resources/de.lproj/Localizable.strings
index f3e5dfe2f1..c340a78770 100644
--- a/platform/ios/resources/de.lproj/Localizable.strings
+++ b/platform/ios/resources/de.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Der Statuscode ist %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Abbrechen";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/es.lproj/Localizable.strings b/platform/ios/resources/es.lproj/Localizable.strings
index 90811be973..b2da706d8c 100644
--- a/platform/ios/resources/es.lproj/Localizable.strings
+++ b/platform/ios/resources/es.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "El código de estado fue %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Cancelar";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/fr.lproj/Localizable.strings b/platform/ios/resources/fr.lproj/Localizable.strings
index f75d067251..17a0240517 100644
--- a/platform/ios/resources/fr.lproj/Localizable.strings
+++ b/platform/ios/resources/fr.lproj/Localizable.strings
@@ -1,7 +1,7 @@
/* Accessibility hint */
"ANNOTATION_A11Y_HINT" = "Afficher plus d’informations";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Annuler";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/gl.lproj/Localizable.strings b/platform/ios/resources/gl.lproj/Localizable.strings
index 2ab14fd0b5..083423d434 100644
--- a/platform/ios/resources/gl.lproj/Localizable.strings
+++ b/platform/ios/resources/gl.lproj/Localizable.strings
@@ -1,7 +1,7 @@
/* Accessibility hint */
"ANNOTATION_A11Y_HINT" = "Amosa máis información";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Desbotar";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/he.lproj/Localizable.strings b/platform/ios/resources/he.lproj/Localizable.strings
index 9503c16d3d..2e4c9a17fb 100644
--- a/platform/ios/resources/he.lproj/Localizable.strings
+++ b/platform/ios/resources/he.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "סטטוס הקוד היה %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "ביטול";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/hu.lproj/Localizable.strings b/platform/ios/resources/hu.lproj/Localizable.strings
index e4c9882600..bac747b4a2 100644
--- a/platform/ios/resources/hu.lproj/Localizable.strings
+++ b/platform/ios/resources/hu.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "A státuszkód %ld volt";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Mégse";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/ja.lproj/Localizable.strings b/platform/ios/resources/ja.lproj/Localizable.strings
index 0bcb706cae..0b5429b487 100644
--- a/platform/ios/resources/ja.lproj/Localizable.strings
+++ b/platform/ios/resources/ja.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "The status code was %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "キャンセル";
/* Accessibility hint */
diff --git a/platform/ios/resources/ko.lproj/Localizable.strings b/platform/ios/resources/ko.lproj/Localizable.strings
index 40136803d1..6374fc72df 100644
--- a/platform/ios/resources/ko.lproj/Localizable.strings
+++ b/platform/ios/resources/ko.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "상태 코드 %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "취소";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/lt.lproj/Localizable.strings b/platform/ios/resources/lt.lproj/Localizable.strings
index e8424434b9..2f2e30f966 100644
--- a/platform/ios/resources/lt.lproj/Localizable.strings
+++ b/platform/ios/resources/lt.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Būklės kodas: %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Atšaukti";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/pt-BR.lproj/Localizable.strings b/platform/ios/resources/pt-BR.lproj/Localizable.strings
index 4e7e998ab3..d80c943c7e 100644
--- a/platform/ios/resources/pt-BR.lproj/Localizable.strings
+++ b/platform/ios/resources/pt-BR.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "O código de status foi %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Cancelar";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/pt-PT.lproj/Localizable.strings b/platform/ios/resources/pt-PT.lproj/Localizable.strings
index bed26df478..8104ef5842 100644
--- a/platform/ios/resources/pt-PT.lproj/Localizable.strings
+++ b/platform/ios/resources/pt-PT.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "O código de estado era %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Cancelar";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/ru.lproj/Localizable.strings b/platform/ios/resources/ru.lproj/Localizable.strings
index b6ceffd520..5bb987489e 100644
--- a/platform/ios/resources/ru.lproj/Localizable.strings
+++ b/platform/ios/resources/ru.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Код ответа %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Отмена";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/sv.lproj/Localizable.strings b/platform/ios/resources/sv.lproj/Localizable.strings
index d136f9e52f..db189f141f 100644
--- a/platform/ios/resources/sv.lproj/Localizable.strings
+++ b/platform/ios/resources/sv.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Statuskoden var %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Avbryt";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/uk.lproj/Localizable.strings b/platform/ios/resources/uk.lproj/Localizable.strings
index 4e5a452b95..f413b963c1 100644
--- a/platform/ios/resources/uk.lproj/Localizable.strings
+++ b/platform/ios/resources/uk.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Код стану %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Скасувати";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/vi.lproj/Localizable.strings b/platform/ios/resources/vi.lproj/Localizable.strings
index 06242a39e7..0a6d937d2c 100644
--- a/platform/ios/resources/vi.lproj/Localizable.strings
+++ b/platform/ios/resources/vi.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "Mã trạng thái là %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "Hủy bỏ";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/zh-Hans.lproj/Localizable.strings b/platform/ios/resources/zh-Hans.lproj/Localizable.strings
index 1a3453e209..98d4e345fa 100644
--- a/platform/ios/resources/zh-Hans.lproj/Localizable.strings
+++ b/platform/ios/resources/zh-Hans.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "The status code was %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "取消";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/resources/zh-Hant.lproj/Localizable.strings b/platform/ios/resources/zh-Hant.lproj/Localizable.strings
index d660a3d1ae..abdee6d3ab 100644
--- a/platform/ios/resources/zh-Hant.lproj/Localizable.strings
+++ b/platform/ios/resources/zh-Hant.lproj/Localizable.strings
@@ -7,7 +7,7 @@
/* No comment provided by engineer. */
"API_CLIENT_400_REASON" = "The status code was %ld";
-/* No comment provided by engineer. */
+/* Title of button for dismissing attribution action sheet */
"CANCEL" = "取消";
/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index 2423d62ee1..607a197840 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.
*/
-- (nullable MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets;
+- (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.
*/
-- (nullable MGLMapCamera *)camera:(MGLMapCamera *)camera fittingCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets;
+- (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.
*/
-- (nullable MGLMapCamera *)camera:(MGLMapCamera *)camera fittingShape:(MGLShape *)shape edgePadding:(UIEdgeInsets)insets;
+- (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.
*/
-- (nullable MGLMapCamera *)cameraThatFitsShape:(MGLShape *)shape direction:(CLLocationDirection)direction edgePadding:(UIEdgeInsets)insets;
+- (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 b5383ee30e..7cebd57710 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -2481,7 +2481,7 @@ public:
}];
[attributionController addAction:telemetryAction];
- NSString *cancelTitle = NSLocalizedStringWithDefaultValue(@"CANCEL", nil, nil, @"Cancel", @"Cancel");
+ NSString *cancelTitle = NSLocalizedStringWithDefaultValue(@"CANCEL", nil, nil, @"Cancel", @"Title of button for dismissing attribution action sheet");
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelTitle
style:UIAlertActionStyleCancel
handler:NULL];
@@ -3873,9 +3873,9 @@ public:
{
if (!_mbglMap)
{
- return nil;
+ return self.residualCamera;
}
-
+
mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets);
padding += MGLEdgeInsetsFromNSEdgeInsets(self.contentInset);
mbgl::CameraOptions cameraOptions = self.mbglMap.cameraForLatLngBounds(MGLLatLngBoundsFromCoordinateBounds(bounds), padding);
@@ -3886,7 +3886,7 @@ public:
{
if (!_mbglMap)
{
- return nil;
+ return self.residualCamera;
}
mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets);
@@ -3903,7 +3903,7 @@ public:
- (MGLMapCamera *)camera:(MGLMapCamera *)camera fittingShape:(MGLShape *)shape edgePadding:(UIEdgeInsets)insets {
if (!_mbglMap)
{
- return nil;
+ return self.residualCamera;
}
mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets);
@@ -3921,7 +3921,7 @@ public:
- (MGLMapCamera *)cameraThatFitsShape:(MGLShape *)shape direction:(CLLocationDirection)direction edgePadding:(UIEdgeInsets)insets {
if (!_mbglMap)
{
- return nil;
+ return self.residualCamera;
}
mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(insets);
@@ -3936,7 +3936,7 @@ public:
{
if (!_mbglMap)
{
- return nil;
+ return self.residualCamera;
}
mbgl::CameraOptions mapCamera = self.mbglMap.getCameraOptions();
diff --git a/platform/ios/vendor/SMCalloutView/SMCalloutView.m b/platform/ios/vendor/SMCalloutView/SMCalloutView.m
index 0520ba08a5..06626f9497 100755
--- a/platform/ios/vendor/SMCalloutView/SMCalloutView.m
+++ b/platform/ios/vendor/SMCalloutView/SMCalloutView.m
@@ -520,52 +520,58 @@ NSTimeInterval const kMGLSMCalloutViewRepositionDelayForUIScrollView = 1.0/3.0;
- (CAAnimation *)animationWithType:(MGLSMCalloutAnimation)type presenting:(BOOL)presenting {
CAAnimation *animation = nil;
- if (type == MGLSMCalloutAnimationBounce) {
-
- CABasicAnimation *fade = [CABasicAnimation animationWithKeyPath:@"opacity"];
- fade.duration = 0.23;
- fade.fromValue = presenting ? @0.0 : @1.0;
- fade.toValue = presenting ? @1.0 : @0.0;
- fade.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
-
- CABasicAnimation *bounce = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
- bounce.duration = 0.23;
- bounce.fromValue = presenting ? @0.7 : @1.0;
- bounce.toValue = presenting ? @1.0 : @0.7;
- bounce.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.59367:0.12066:0.18878:1.5814];
-
- CAAnimationGroup *group = [CAAnimationGroup animation];
- group.animations = @[fade, bounce];
- group.duration = 0.23;
-
- animation = group;
- }
- else if (type == MGLSMCalloutAnimationFade) {
- CABasicAnimation *fade = [CABasicAnimation animationWithKeyPath:@"opacity"];
- fade.duration = 1.0/3.0;
- fade.fromValue = presenting ? @0.0 : @1.0;
- fade.toValue = presenting ? @1.0 : @0.0;
- animation = fade;
- }
- else if (type == MGLSMCalloutAnimationStretch) {
- CABasicAnimation *stretch = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
- stretch.duration = 0.1;
- stretch.fromValue = presenting ? @0.0 : @1.0;
- stretch.toValue = presenting ? @1.0 : @0.0;
- animation = stretch;
+ switch (type)
+ {
+ case MGLSMCalloutAnimationBounce:
+ {
+ CABasicAnimation *fade = [CABasicAnimation animationWithKeyPath:@"opacity"];
+ fade.duration = 0.23;
+ fade.fromValue = presenting ? @0.0 : @1.0;
+ fade.toValue = presenting ? @1.0 : @0.0;
+ fade.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
+
+ CABasicAnimation *bounce = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
+ bounce.duration = 0.23;
+ bounce.fromValue = presenting ? @0.7 : @1.0;
+ bounce.toValue = presenting ? @1.0 : @0.7;
+ bounce.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.59367:0.12066:0.18878:1.5814];
+
+ CAAnimationGroup *group = [CAAnimationGroup animation];
+ group.animations = @[fade, bounce];
+ group.duration = 0.23;
+
+ animation = group;
+ break;
+ }
+
+ case MGLSMCalloutAnimationFade:
+ {
+ CABasicAnimation *fade = [CABasicAnimation animationWithKeyPath:@"opacity"];
+ fade.duration = 1.0/3.0;
+ fade.fromValue = presenting ? @0.0 : @1.0;
+ fade.toValue = presenting ? @1.0 : @0.0;
+ animation = fade;
+ break;
+ }
+
+ case MGLSMCalloutAnimationStretch:
+ {
+ CABasicAnimation *stretch = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
+ stretch.duration = 0.1;
+ stretch.fromValue = presenting ? @0.0 : @1.0;
+ stretch.toValue = presenting ? @1.0 : @0.0;
+ animation = stretch;
+ break;
+ }
}
-
- 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;
- // 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;
+ return animation;
}
- (void)layoutSubviews {