Open benoit-pereira-da-silva opened 11 years ago
_observerForUIKeyboard*
for? You don't seem to do anything with these. [[NSNotificationCenter defaultCenter] removeObserver:self]
would be enough.Sorry for the approximative english ( i'm a french frog)
I've actually never used addObserverForName:object:queue:usingBlock:
. Didn't realize that it returned the observer. I prefer addObserver:selector:name:object:
because you can simply do removeObserver:self
to remove all observers in one call. It ensures all future observers are cleaned up. In this case I prefer not to use blocks.
The LSCollectionViewHelper is released when your UICollectionView is, by association.
I feel there are too many edge cases with this patch. It would be better if:
enabled
should not be changed. It can be changed after the keyboard appears, and then overwritten when the keyboard is dismissed.To be honest I feel like this issue may be beyond the scope of this addon. One thing I can do is add a "will begin dragging" delegate call so you can dismiss the keyboard if the user begins dragging. If the text field takes up the entire cell, it may be better just to keep draggable
disabled until you enable it with a button or something. The long press may be interfering with the text loupe anyway.
Thanks for taking the time to analyze. The will begin dragging idea is not bad.
We disable on UIKeyboardWillShowNotification and re-enable on UIKeyboardDidHideNotification if necessary to prevent from an IOS SDK internal bug : UICollectionViewUpdateItem missing selector crash.