I have a SwiftUI app which supports both LTR and RTL languages. It is not fixated to either one of those, it just depends on what user wants.
I have a horizontally scrollable list of things inside a vertically scrollable list of things, previously achieved by UICollectionView
inside a UITableViewCell
inside a UITableView
.
For RTL, the horizontally scrollable row needs to be on the first element by default which is the rightmost (opposite of LTR obviously). I have found no way yet to make this happen.
I tried flipsForRightToLeftLayoutDirection(_:)
but the problem is it flips everything, including the Text()
inside the scrolling views. So the Arabic text looks mirrored.
Here is my skeleton of the view -
ScrollView(.horizontal) {
LazyHStack {
ForEach(things) { thing in
Text(thing.name)
}
}
}
Any ideas on how to achieve this? Thanks in advance.