IPad. UIBarButtonItem has an undocumented view of type UIToolbarTextButton. BUT?

I have an iPad application in which I have a view controller that is a UIGestureRecognizerDelegate for a series of UIGestureRecognizers. I applied the following UIGestureRecognizerDelegate method:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { // Double tapping anywhere on the screen hides/shows the toolbar if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] == YES) { if (touch.tapCount == 2) { self.toolbar.hidden = self.toolbar.isHidden ? NO : YES; } // if (touch.tapCount == 2) } // if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] == YES) // All gestures are ignored unless they happen on the fullscreen EAGLView if ([touch.view isKindOfClass:[EAGLView class]] == NO) { return NO; } // if ([touch.view isKindOfClass:[EAGLView class]] == NO) return YES; 

}

My setup is a full-screen EAGLView with UIToolbar on top of EAGLView. The toolbar has a UIBarButtonItem. The idea here is that double-clicking allows you to switch the appearance of the toolbar. All other gestures must occur in EAGLView.

My problem is that the taps directly on the UIBarButtonItem show touch.view as a subclass of the UIView UIToolbarTextButton, which is undocumented and cannot be introduced.

BUT?

Could someone offer a job, preferably using introspective kindness of some kind?

Thank,
Doug

Thank,

Arc

+1
ipad introspection uigesturerecognizer uitoolbar uitouch
May 01 '10 at 1:18
source share
1 answer

You can recalculate .superview until you reach UIToolbar, EAGLView, or nil .

+3
May 01 '10 at 6:41
source share



All Articles