I notice if I remove this code:
[[UIView appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
from my AppDelegate, UIAlertController works fine
But I need that code to force everything to LTR even in RTL language. With above code in use, UIAlertController is not working like my post above
Here's my code for UIAlertControllerStyleAlert style:
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action1 = [UIAlertAction actionWithTitle:[TheApp localizedStringForKey:@"NO" inTable:kDefaultStringsFile] style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
}];
UIAlertAction *action2 = [UIAlertAction actionWithTitle:[TheApp localizedStringForKey:@"YES" inTable:kDefaultStringsFile] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
}];
[alertController addAction:action1];
[alertController addAction:action2];
[self presentViewController:alertController animated:YES completion:nil];
And ActionSheet:
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:[TheApp localizedStringForKey:@"CANCEL" inTable:kDefaultStringsFile] style:UIAlertActionStyleCancel handler:^(UIAlertAction *action){
}];
UIAlertAction *libraryAction = [UIAlertAction actionWithTitle:[TheApp localizedStringForKey:@"PHOTO_LIBRARY" inTable:kDefaultStringsFile] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
}];
UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:[TheApp localizedStringForKey:@"CAMERA" inTable:kDefaultStringsFile] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
}];
[actionSheet addAction:cancelAction];
[actionSheet addAction:libraryAction];
[actionSheet addAction:cameraAction];
[self presentViewController:actionSheet animated:YES completion:nil];