summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Karlsson <bjorn.fredrik.karlsson@gmail.com>2017-10-02 16:23:50 +0200
committerFredrik Karlsson <bjorn.fredrik.karlsson@gmail.com>2017-10-03 13:28:22 +0200
commit42b4818f16f98a14fd14853ad10b0fdd742cd1f1 (patch)
tree64495f849afaee2d834d4cfb20e63c81e3515a8e
parentd4992ab0b0a707d53835cf658968972097c7cc81 (diff)
downloadqtlocation-mapboxgl-42b4818f16f98a14fd14853ad10b0fdd742cd1f1.tar.gz
[ios] check at compile time
-rw-r--r--platform/darwin/src/NSString+MGLAdditions.m2
1 files changed, 2 insertions, 0 deletions
diff --git a/platform/darwin/src/NSString+MGLAdditions.m b/platform/darwin/src/NSString+MGLAdditions.m
index bca6feb1f4..cde4bddcc3 100644
--- a/platform/darwin/src/NSString+MGLAdditions.m
+++ b/platform/darwin/src/NSString+MGLAdditions.m
@@ -13,12 +13,14 @@
- (NSString *)mgl_titleCasedStringWithLocale:(NSLocale *)locale {
NSMutableString *string = self.mutableCopy;
NSOrthography *orthography;
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
if ([NSOrthography respondsToSelector:@selector(defaultOrthographyForLanguage:)]) {
orthography = [NSOrthography defaultOrthographyForLanguage:locale.localeIdentifier];
}
#pragma clang diagnostic pop
+#endif
[string enumerateLinguisticTagsInRange:string.mgl_wholeRange scheme:NSLinguisticTagSchemeLexicalClass options:0 orthography:orthography usingBlock:^(NSString * _Nonnull tag, NSRange tokenRange, NSRange sentenceRange, BOOL * _Nonnull stop) {
NSString *word = [string substringWithRange:tokenRange];
if (word.length > 3