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

bindViewModel has wrong cellSize #1248

Open
maxifuchs opened this issue Sep 1, 2018 · 2 comments
Open

bindViewModel has wrong cellSize #1248

maxifuchs opened this issue Sep 1, 2018 · 2 comments

Comments

@maxifuchs
Copy link

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<ListDiffable>, 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.

@rnystrom
Copy link
Contributor

This is probably an issue with how XIBs work. We don’t use them at all in Instagram so I’m not surprised this hasn’t come up.

Can you repro the issue in an example app or better-yet unit test?

I won’t be able to work on a fix for this, but I’d gladly accept a PR!

Sent with GitHawk

@mstafakv
Copy link

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

No branches or pull requests

3 participants