An additional view should be a UICollectionReusableView (or its subclass), and not a UICollectionViewCell .
In any case, if the button does not respond, the first thing to do is verify that all its ancestor views have userInteractionEnabled set to YES . Pause in the debugger after pressing a button on the screen and do the following:
(lldb) po [[UIApp keyWindow] recursiveDescription]
Find the button in the list and copy its address. You can then check this and each view. Example:
(lldb) p (BOOL)[0xa2e4800 isUserInteractionEnabled] (BOOL) $4 = YES (lldb) p (BOOL)[[0xa2e4800 superview] isUserInteractionEnabled] (BOOL) $5 = YES (lldb) p (BOOL)[[[0xa2e4800 superview] superview] isUserInteractionEnabled] (BOOL) $6 = YES (lldb) p (BOOL)[[[[0xa2e4800 superview] superview] superview] isUserInteractionEnabled] (BOOL) $8 = YES (lldb) p (BOOL)[[[[[0xa2e4800 superview] superview] superview] superview] isUserInteractionEnabled] (BOOL) $9 = YES (lldb) p (BOOL)[[[[[[0xa2e4800 superview] superview] superview] superview] superview] isUserInteractionEnabled] (BOOL) $10 = NO (lldb) po [[[[[0xa2e4800 superview] superview] superview] superview] superview] (id) $11 = 0x00000000 <nil>
Here I found that all views to the root ( UIWindow ) return YES from isUserInteractionEnabled . The supervisor window is zero.
rob mayoff
source share