0

I am using swreveal view controller I want after click on menu then we should unable to interact with front view if we tap on front view then rear should close. I am using the below code for disable the interaction but if we disable the interaction then tap guesture also will not work.

 - (void)revealController:(SWRevealViewController *)revealController willMoveToPosition:    (FrontViewPosition)position {
if(position == FrontViewPositionLeft) {
    self.view.userInteractionEnabled = YES;
} else {
    self.view.userInteractionEnabled = NO;
}
}

- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:    (FrontViewPosition)position {
if(position == FrontViewPositionLeft) {
    self.view.userInteractionEnabled = YES;
} else {
    self.view.userInteractionEnabled = YES;
  hideFilter=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];

    hideFilter.backgroundColor=[UIColor blueColor];
    [self.view addSubview:hideFilter];

    SWRevealViewController *reveal = self.revealViewController;
    reveal.delegate = self;
    if ( reveal )
    {
        [hideFilter addGestureRecognizer:self.revealViewController.tapGestureRecognizer];
        [hideFilter addGestureRecognizer:self.revealViewController.panGestureRecognizer];
    }
  }
}

I used the hidefilter to hide the interaction from self.view and add a gusture on it but after click on it this view should remove and interact main view. then how can I do this. if there is another way to do this please tell Thank

Ankur
  • 1
  • 4

1 Answers1

0

It sounds like you're saying that you want the top view to allow taps (or gestures) to pass thru to the view below it.

If so, here are a few Stack Overflow answers that will help you:

How to send touch events to superview in iOS?

iOS - forward all touches through a view

Community
  • 1
  • 1
Axeva
  • 4,697
  • 6
  • 40
  • 64