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 for UICollectionViewListLayout? #4

Open
niklasgrewe opened this issue Nov 17, 2021 · 2 comments
Open

Support for UICollectionViewListLayout? #4

niklasgrewe opened this issue Nov 17, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@niklasgrewe
Copy link

niklasgrewe commented Nov 17, 2021

Hi, thank you very much to simplify the process of defining and updating UICollectionView Compositional Layout 👍 Does ListKit also supports UICollectionView List Layout, which is available since iOS 14? I would be very happy about this because then we can use UIKit APIs for Swipe Actions and don't have to use libraries like SwipeCellKit...

maybe like this:

renderer.render {
    Section(id: Sections.main) {
        if todos.isEmpty {
            VGroup(width: .fractionalWidth(1.0), height: .estimated(30)) {
                EmptyComponent(title: "Add New Todo!")
            }
        } else {
            List(of: todos) { todo in
                TodoComponent(todo: todo) { [weak self] t in
                    self?.todos.removeAll(where: { $0 == t })
                }
            }
            .listAppearance(.insetGrouped)
        }
    }
}

List is the class to create a new UICollectionViewListLayout with an Anppearance . It would be nice, if List can support both custom cells and default UICollectionViewListCell with content and background configuration.

The following article is a good starting point:
https://swiftsenpai.com/development/uicollectionview-list-basic/

Let me know what you think about it. Carbon uses UITableView, but since iOS 14, there is no need to do this, because you can do everthing with UICollectionView.

@skyfe79
Copy link
Member

skyfe79 commented Nov 19, 2021

Thanks for your great suggestion. I want to support UICollectionView List Layout but I think it will take some time. 😭

@skyfe79 skyfe79 added enhancement New feature or request good first issue Good for newcomers labels Nov 19, 2021
@skyfe79 skyfe79 self-assigned this Nov 19, 2021
@niklasgrewe
Copy link
Author

@skyfe79 Hi any news about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants