File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -161,18 +161,16 @@ - (BOOL)isAppExtension
161161 return [[NSBundle mainBundle ].executablePath rangeOfString: @" .appex/" ].location != NSNotFound ;
162162}
163163
164-
165164-(BOOL ) isRTLLocale
166165{
167- if ([[UIView class ] respondsToSelector: @selector ( userInterfaceLayoutDirectionForSemanticContentAttribute: )] ) {
166+ if (@ available (iOS 9 , *) ) {
168167 return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute: self .semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
168+ }
169+ else if ([self isAppExtension ]) {
170+ return [NSLocale characterDirectionForLanguage: [[NSLocale currentLocale ] objectForKey: NSLocaleLanguageCode ]]==NSLocaleLanguageDirectionRightToLeft;
169171 } else {
170- if ([self isAppExtension ]) {
171- return [NSLocale characterDirectionForLanguage: [[NSLocale currentLocale ] objectForKey: NSLocaleLanguageCode ]]==NSLocaleLanguageDirectionRightToLeft;
172- } else {
173- UIApplication *application = [UIApplication performSelector: @selector (sharedApplication )];
174- return application.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
175- }
172+ UIApplication *application = [UIApplication performSelector: @selector (sharedApplication )];
173+ return application.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
176174 }
177175}
178176
Original file line number Diff line number Diff line change @@ -658,15 +658,14 @@ - (BOOL)isAppExtension
658658
659659-(BOOL ) isRTLLocale
660660{
661- if ([[UIView class ] respondsToSelector: @selector ( userInterfaceLayoutDirectionForSemanticContentAttribute: )] ) {
661+ if (@ available (iOS 9 , *) ) {
662662 return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute: self .semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
663+ }
664+ else if ([self isAppExtension ]) {
665+ return [NSLocale characterDirectionForLanguage: [[NSLocale currentLocale ] objectForKey: NSLocaleLanguageCode ]]==NSLocaleLanguageDirectionRightToLeft;
663666 } else {
664- if ([self isAppExtension ]) {
665- return [NSLocale characterDirectionForLanguage: [[NSLocale currentLocale ] objectForKey: NSLocaleLanguageCode ]]==NSLocaleLanguageDirectionRightToLeft;
666- } else {
667- UIApplication *application = [UIApplication performSelector: @selector (sharedApplication )];
668- return application.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
669- }
667+ UIApplication *application = [UIApplication performSelector: @selector (sharedApplication )];
668+ return application.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;
670669 }
671670}
672671
You can’t perform that action at this time.
0 commit comments