this is a pretty straightforward question, but I haven\'t been able to find a definitive answer to it on SO (if I missed it, please correct me).
Basically, my quest
UICollectionView
already support rtl direction if UICollectionViewFlowLayout
is not dynamic.
Changing Estimate size to None as the image shows automatically changed the direction of the CollectionView.
One more issue is to scroll to the end of the collection view after reloading data.
extension UICollectionView {
func scrollToEndIfArabic() {
if Language.shared.isArabic() {
DispatchQueue.main.async {
self.contentOffset
= CGPoint(x: self.contentSize.width
- self.frame.width
+ self.contentInset.right, y: 0)
}
}
}
}