Blank layout supporting right to left

Does IOS pure Layout support right-left languages? How can we implement it in the code for the Arabic language without having to go to the settings and choose the language of the region and format.

thanks

0
source share
2 answers

You can test the layouts from right to left by selecting the application scheme in Xcode โ†’ Edit Scheme ... โ†’ โ€œRunโ€ โ†’ the โ€œOptionsโ€ tab โ†’ Application Language โ†’ Pseudo Left-Right Language.

It is strongly recommended that you use Auto Layout to indicate your layouts in your views, and most of the work will be done for you if you run the application in these languages.

For more information, right-handed language support is a great starter.

+3
source

Yes, you can do RTL iPhone support (Arabic language support)

// For Swift 4.0

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. //if UserDefaults.languageCode == "ar" { UIView.appearance().semanticContentAttribute = .forceRightToLeft //SMP: LTR to RTL //} โ€ฆ } extension UITextField { open override func awakeFromNib() { super.awakeFromNib() //if UserDefaults.languageCode == "ar" { if textAlignment == .natural { self.textAlignment = .right } //} } } extension UILabel { open override func awakeFromNib() { super.awakeFromNib() //if UserDefaults.languageCode == "ar" { if textAlignment == .natural { self.textAlignment = .right } //} } } 
0
source

All Articles