Skip to content

[Request] Changes in one column should not affect adjacent column #3

@rajdhakate

Description

@rajdhakate

Hi, thanks for the library, works great.
I've a request, I've two column setup like below. On changing height of an item, only that column height should get updated without affecting the adjacent column. How can we do that?

Thanks again

    private func setupCollectionView() {
        let configuration = WaterfallTrueCompositionalLayout.Configuration(
            columnCount: 2,
            interItemSpacing: 0,
            contentInsetsReference: .automatic,
            itemCountProvider: { [unowned self] in
                return self.items
            },
            itemHeightProvider: { [unowned self] row, _ in
                if let currentValue = expandedIndexes[row], currentValue {
                    return self.cardHeight*2
                }
                return self.cardHeight
            }
        )

        let layout = UICollectionViewCompositionalLayout { sectionIndex, environment in
            let section = WaterfallTrueCompositionalLayout.makeLayoutSection(
                config: configuration,
                environment: environment,
                sectionIndex: sectionIndex
            )
            return section
        }
        collectionView.setCollectionViewLayout(layout, animated: true)

        collectionView.delegate = self
        collectionView.dataSource = self
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions