2

I'm trying to force my app to be RTL on app start. Everything works fine on iOS 9, using:

if(version >= 9.0){
   [[UIView appearance] setSemanticContentAttribute:UISemanticContentAttributeForceLeftToRight];
}

Now I'm testing it on iOS 8 and of course this method doesn't work.

Does anyone know the equivalent of the method that work for iOS 8?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Max
  • 799
  • 1
  • 5
  • 17

2 Answers2

0

If you are doing this for testing while in development then you can do this with an option in the Xcode run scheme...

enter image description here

This will override the RTL setting for the phone for the debug session.

Fogmeister
  • 76,236
  • 42
  • 207
  • 306
  • thanks for your reply. im actually trying to force any production ver to go RTL, on app start (somewhere in AppDelegate). i got it going with the language, both ios 8 and 9. now i want app semantic to be RTL as well (when it reads the view constraints as RTL as well). ive done it for ios 9 as i post in my question but i cant find it for ios lower then this. – Max Sep 07 '16 at 11:37
0

For iOS 8, you can use the UIApplication layout direction :

BOOL isRTL = [UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft;