Skip to content

Fix ordering of adding long press gesture recognizer #24

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

Merged
merged 1 commit into from
May 2, 2013
Merged

Fix ordering of adding long press gesture recognizer #24

merged 1 commit into from
May 2, 2013

Conversation

jhersh
Copy link
Contributor

@jhersh jhersh commented Apr 9, 2013

I'm seeing repeatable crashes upon dealloc in the UILongPressGestureRecognizer associated with LXReorderableCollectionViewFlowLayout.

I believe this stems from the order in which LXReorderableCollectionViewFlowLayout sets up its gesture recognizers on the collection view in setupCollectionView.

Specifically, my collection view does not have a default long press gesture recognizer, so when setupCollectionView calls -requireGestureRecognizerToFail to attach it to the default long press recognizer, it actually ends up requiring itself to fail and thusly (I'd guess) prevents itself from being deallocated.

The fix is simple: don't add the new long press gesture recognizer to the collection view until after any other -requireGestureRecognizerToFail dependencies are set up.

@DaGaMs
Copy link

DaGaMs commented Apr 21, 2013

indeed, I got the same crashes when popping the collectionview from the view hierarchy. I fixed it in my branch but won't send a pull request as you've already done so ;-)

lxcid added a commit that referenced this pull request May 2, 2013
Fix ordering of adding long press gesture recognizer
@lxcid lxcid merged commit c21e1b0 into lxcid:master May 2, 2013
@lxcid
Copy link
Owner

lxcid commented May 2, 2013

Thanks for the fix guys. This should have been merge in much earlier. Sorry for the delay!

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

Successfully merging this pull request may close these issues.

3 participants