Instagram / Instagram/IGListKit

bindViewModel has wrong cellSize

Open
#1,248 2 comments 0 reactions 0 assignees View on GitHub
bug starter-task
Dominant language
Objective-C
Stars
13.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### General information

- `IGListKit` version: 3.4.0
- iOS version(s): 11.4
- Xcode version: 9.4.1
- Reproducible in the demo project?: Yes

Hello,
I think I found a bug: If you call `contentView.frame.size` inside your `bindViewModel` method, it returns the size of the xib (in storyboard), not the size of the cell, which was specified in the `sectionController(_ sectionController: ListBindingSectionController, sizeForViewModel viewModel: Any, at index: Int)`.
This bug also occurs in the `IGListKit-Binding-Guide` example project.

The cell still has the right size (from `sizeForViewModel`), but I’m creating a MKSnapshotter inside `bindViewModel`, which unfortunately uses the wrong size of the contentView.

In my project, the bug only occurs when the cell is loaded for the first time. After that, `contentView.frame.size` returns the correct size.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.