Search code examples
iosautolayoutxibnslocale

Changing the UI on the fly - iOS


As far as i know, Auto-layout supports both RTL and LTR for the current held device language. But i need to my UI elements to support LTR according to a language selection button . Is there any possible way to reload the UI using Autolayout?


Solution

  • Make two arrays as properties, holding the constraints for LTR layout and RTL layout. Depending on the selected state you remove one set from the view and add the other.

    It means doing programmatic auto layout but that's not really too bad. The guide provided in the docs is an easy read.