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

Fix reusing collection views among multiple adapters #721

Closed
wants to merge 2 commits into from

Conversation

rnystrom
Copy link
Contributor

@rnystrom rnystrom commented May 9, 2017

Changes in this pull request

When multiple UICollectionViews are reused among multiple IGListAdapters (horizontal lists embedded in a bigger, vertical list), the mapping between the old view and adapter is not broken. When a new collection view is attached to the old adapter, an unrelated adapter->collection view reference will be erroneously broken.

The unit test in this diff fails on the second XCTAssertEqual(adapter2.collectionView, collectionView1); without this patch.

Issue fixed: #699

t15661237 internally

cc @amonshiz since we were talking about this

Checklist

  • All tests pass. Demo project builds and runs.
  • I added tests, an experiment, or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.

@rnystrom
Copy link
Contributor Author

rnystrom commented May 9, 2017

h/t @yifanpeng for finding this!

Importing for more eyeballs & faster CI

@facebook-github-bot
Copy link
Contributor

@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@jessesquires jessesquires added this to the 3.0.0 milestone May 9, 2017
@jessesquires jessesquires deleted the embed-crash branch May 9, 2017 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash with embedded CollectionView
3 participants