Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RTL Directions #155

Open
AbuMandour opened this issue Oct 21, 2020 · 0 comments
Open

Support RTL Directions #155

AbuMandour opened this issue Oct 21, 2020 · 0 comments

Comments

@AbuMandour
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant