Is there a way to easily determine if the language the device is set to is right to left (RTL)?
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.view.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) {
NSLog(@"Right to left");
}
else{
NSLog(@"left to Right");
}
} else {
/* Use the previous technique */
//Work for earlier ios 6 to ios 10
if ([NSLocale characterDirectionForLanguage:[[NSLocale preferredLanguages] objectAtIndex:0]] == NSLocaleLanguageDirectionRightToLeft) {
NSLog(@"Right to left");
}
else{
NSLog(@"left to Right");
}
}
must watch Advanced Topics in Internationalization wwdc2014