IGListKit icon indicating copy to clipboard operation
IGListKit copied to clipboard

performUpdates not updating cell size especially on the last section item

Open delmarz opened this issue 3 years ago • 0 comments

New issue checklist

  • [/ ] I have reviewed the README and documentation
  • [ /] I have searched existing issues and this is not a duplicate
  • [/ ] I have attempted to reproduce the issue and include an example project.

General information

  • IGListKit version: 4.0.0
  • iOS version(s): 15.2
  • CocoaPods/Carthage version:
  • Xcode version: 13
  • Devices/Simulators affected: All device
  • Reproducible in the demo project? (Yes/No):
  • Related issues:

Debug information

# Please include debug logs using the following lldb command:
po [IGListDebugger dump]

I have the app the in every section can able to click "show more" to expand cell size. The 'show more' functionality working well on on the setup the only problem is when I click the last item it doesn't update the cell bottom inset

extension ExperienceDetailSectionController: ExperiencesDetailCellDelegate {
    func experiencesDetailCellDidTapShowMore(_ experiencesDetailCell: ExperiencesDetailCollectionViewCell) {
        collectionContext?.performBatch(animated: true, updates: { [weak self] (context) in
            guard let strongSelf = self else { return }
            strongSelf.sectionModel.isExpanded = true
            context.reload(strongSelf)
        }, completion: nil)
    }
}

    override func sizeForItem(at index: Int) -> CGSize {
        guard let context = collectionContext else { return .zero }
        let width = context.containerSize.width
        return ExperiencesDetailCollectionViewCell.cellSize(forCellModel: sectionModel.cellModel, allowedWidth: width)
    }

Is there anyway I can update the last section to set the bottom cell inset ?

https://user-images.githubusercontent.com/7381514/151698073-fb0f1c61-54d7-4f85-aba4-e31028d69eed.mov

delmarz avatar Jan 30 '22 11:01 delmarz