0

I can't figure out how enable iOS to pass events from a childViewController down to its parentviewcontroller.

My childviewcontroller is like an overlay it's root view is transparent and it's opaque views cover a dynamic area - potentially the the entire parentviewcontroller (thus the root view of the childviewcontroller has the same frame as the parent).

Though only the opaque part of the childViewController's views should receive events. All other events I would like to get forwarded in the responderChain down to the parentviewcontrollers views. Just as if all views were sharing one viewcontroller.

Jakob
  • 1,126
  • 3
  • 16
  • 38
  • Check this out http://stackoverflow.com/questions/27353705/transfer-touch-to-the-parent-view-without-disabling-the-user-interaction-of-chil – Vishnu gondlekar Jan 28 '16 at 15:01

1 Answers1

1

I have made an instance of this class:

@interface SilentView : UIView

@end

@implementation SilentView

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
    UIView *hitView = [super hitTest:point withEvent:event];
    if (hitView == self) {
        return nil;
    }
    return hitView;
}

@end

the rootview of my childViewController. That works for me.

Jakob
  • 1,126
  • 3
  • 16
  • 38