Commit dac8ea4 1 parent d036d47 commit dac8ea4 Copy full SHA for dac8ea4
File tree 2 files changed +12
-15
lines changed
2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -161,18 +161,16 @@ - (BOOL)isAppExtension
161
161
return [[NSBundle mainBundle ].executablePath rangeOfString: @" .appex/" ].location != NSNotFound ;
162
162
}
163
163
164
-
165
164
-(BOOL ) isRTLLocale
166
165
{
167
- if ([[UIView class ] respondsToSelector: @selector ( userInterfaceLayoutDirectionForSemanticContentAttribute: )] ) {
166
+ if (@ available (iOS 9 , *) ) {
168
167
return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute: self .semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
168
+ }
169
+ else if ([self isAppExtension ]) {
170
+ return [NSLocale characterDirectionForLanguage: [[NSLocale currentLocale ] objectForKey: NSLocaleLanguageCode ]]==NSLocaleLanguageDirectionRightToLeft;
169
171
} 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;
176
174
}
177
175
}
178
176
Original file line number Diff line number Diff line change @@ -658,15 +658,14 @@ - (BOOL)isAppExtension
658
658
659
659
-(BOOL ) isRTLLocale
660
660
{
661
- if ([[UIView class ] respondsToSelector: @selector ( userInterfaceLayoutDirectionForSemanticContentAttribute: )] ) {
661
+ if (@ available (iOS 9 , *) ) {
662
662
return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute: self .semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
663
+ }
664
+ else if ([self isAppExtension ]) {
665
+ return [NSLocale characterDirectionForLanguage: [[NSLocale currentLocale ] objectForKey: NSLocaleLanguageCode ]]==NSLocaleLanguageDirectionRightToLeft;
663
666
} 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;
670
669
}
671
670
}
672
671
You can’t perform that action at this time.
0 commit comments