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

instanciateViewControllerForCell: indexPath parameter is always nil #25

Closed
stefreak opened this issue Jun 4, 2014 · 1 comment
Closed

Comments

@stefreak
Copy link

stefreak commented Jun 4, 2014

This is because the method
-collectionView:viewControllerForCell:
and therefore
[self.collectionView indexPathForCell:cell]
gets called inside of
-collectionView:cellForItemAtIndexPath:
before the collectionView knows about the cell.

One solution would be to add a third parameter indexPath to collectionView:viewControllerForCell:

Someone has a better idea? Pull request will follow

stefreak pushed a commit to stefreak/TLIndexPathTools that referenced this issue Jun 4, 2014
This makes multiple viewcontroller classes possible in
TLCollectionViewController.

Changes:

- change signature of collectionView:viewControllerForCell: to
  collectionView:viewControllerForCell:atIndexPath:
- update View Controller Backed example
wtmoose pushed a commit that referenced this issue Jun 4, 2014
This makes multiple viewcontroller classes possible in
TLCollectionViewController.

Changes:

- Fix implementation of viewControllerForCell to get correct indexPath during cellFor*AtIndexPath
- update View Controller Backed example
@wtmoose
Copy link
Member

wtmoose commented Jun 4, 2014

Fix included in 0.3.1 published to cocoapods

@wtmoose wtmoose closed this as completed Jun 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants