Search code examples
iosswiftxcodeuinavigationcontroller

iOS UINavigationController How to push view controller from left to right when showing right to left languages


I am planning to localize my iOS application where I have a lot of Navigation controllers and a Home Tab car controller as well.

how do I support navigations from left to right (push view controller from left to right) when supporting right-to-left languages? Do we have any direct setting in the UINavigationController so that it will automatically handle navigation direction or do we need to manually push/animate from left to right?


Solution

  • All standard UIKit components handle LTR/RTL directions automatically. All you need to do is to add a supported language. For example, if the app supports Arabic, and the user set Arabic as their device language, your app will use strings from your Arabic localised strings set (defaulting to your development language if some string is missing,) and the UI will have the RTL direction (including UINavigationController pushing animation.)