CollectionKit
CollectionKit copied to clipboard
Support RTL Directions
iI want to create a simple flow layout that supports RTL, I tried this code but items order always change
let viewSource = ClosureViewSource(viewUpdater: { (view: UILabel, data: String, index: Int) in
view.text = data
view.font = UIFont(name: "GraphikArabic-Bold",size: 12)
view.textColor = DesignSystem.Colors.selectedRedColor.color
})
let sizeSource = { (index: Int, data: String, collectionSize: CGSize) -> CGSize in
return data.size(withAttributes: [
NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 13)])
}
let provider = BasicProvider(
dataSource: dataSource,
viewSource: viewSource,
sizeSource: sizeSource
)
provider.layout = FlowLayout(lineSpacing: 5,
interitemSpacing: 10,
justifyContent: .end,
alignItems: .end,
alignContent: .end)
keywordCollectionView.provider = provider
any help?