apptekstudios / ASCollectionView

A SwiftUI collection view with support for custom layouts, preloading, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support for right to left languages

mesheilah opened this issue · comments

I've tried several ways in order to change the filling of the collection view to be from right to left but to no avail, I also played with the project localization too.

Can anybody help me with this issue ?

I wonder if the setting you are looking for is UICollectionViewLayout. flipsHorizontallyInOppositeLayoutDirection.

I will hopefully have time to look into making a setting for this later, but try forking master and setting that variable to true on line 87 of ASCollectionViewLayout.swift, eg:

let cvLayout = UICollectionViewCompositionalLayout(sectionProvider: sectionProvider, configuration: config)
cvLayout.flipsHorizontallyInOppositeLayoutDirection = true
registerDecorationViews(cvLayout)
return cvLayout

https://developer.apple.com/documentation/uikit/uicollectionviewlayout/2891099-flipshorizontallyinoppositelayou?language=objc

Sorry I was mistaken, that property is read-only... Apple docs say you need a custom layout subclass to override it

For now it seems this requires a custom layout class, so will close the issue as it's outside the scope of ASCollectionView.