Change UITableView direction to Right-to-Left

Omid Golparvar picture Omid Golparvar · Jun 26, 2016 · Viewed 7.8k times · Source

I develop an iOS application and my native language is Persian (a Right-to-Left language). How can I change UITableView direction to right-to-left in iOS programming?

A UITableView with RTL direction has:

  • Icons are at right
  • TableCell detail and button are at left
  • TableView header and footer are right-aligned

like this :

enter image description here

Is there any UI or programming way to do this?

Answer

Sedat Y picture Sedat Y · Nov 29, 2016

Try this on Swift 3

tableView.semanticContentAttribute = .forceRightToLeft

or in StoryBoard Cell properties (Semantic dropdown) select "Force Right-To-Left"

enter image description here