[macos] Fixed title casing based on current orthography

This commit is contained in:
Minh Nguyễn
2018-03-06 00:57:36 -08:00
committed by Minh Nguyễn
parent 6c0599b536
commit 9f708d80f4

View File

@@ -1,5 +1,9 @@
#import "NSString+MGLAdditions.h"
#if TARGET_OS_OSX
#import <Availability.h>
#endif
@implementation NSString (MGLAdditions)
- (NSRange)mgl_wholeRange {
@@ -13,7 +17,7 @@
- (NSString *)mgl_titleCasedStringWithLocale:(NSLocale *)locale {
NSMutableString *string = self.mutableCopy;
NSOrthography *orthography;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
if ([NSOrthography respondsToSelector:@selector(defaultOrthographyForLanguage:)]) {