iDevelopper / PBRevealViewController

A UIViewController subclass for revealing a left and/or right view controller above or below a main view controller.
MIT License
80 stars 16 forks source link

I want to disable interaction with front view when left or right views are revealed.Objective c #18

Closed alisattar456 closed 7 years ago

iDevelopper commented 7 years ago

Use the delegate methods:

- (void)revealController:(PBRevealViewController *)revealController willShowLeftViewController:(UIViewController *)controller
{
    revealController.mainViewController.view.userInteractionEnabled = NO;
}

- (void)revealController:(PBRevealViewController *)revealController willHideLeftViewController:(UIViewController *)controller
{
    revealController.mainViewController.view.userInteractionEnabled = YES;
}
alisattar456 commented 7 years ago

where i paste it in appdelegete in swrevealview controller or main view controller

iDevelopper commented 7 years ago

Where you want. You have to know what is a protocol and a delegate first! Your controller have to adopt the SWRevealViewController protocol and have to set the SWRevealViewController delegate to self for these methods be called. You could also subclass SWRevealViewController and set the delegate to this subclass.

alisattar456 commented 7 years ago

I am uploading my sample project kindly implement the disable interaction with front view when left are revealed and in picture only open gesture is working for open menu but when click it close i want to close with gesture in image 2 i am using webview in this view controller left is revealed successfull but no touch is wokring on webview or gesture to close reveal view

screen shot 2016-11-14 at 2 14 39 pm screen shot 2016-11-14 at 2 29 09 pm

sampleproject.zip

iDevelopper commented 7 years ago

1) I modified DashBordViewController.m for adopting PBRevealViewControllerDelegate protocol and add the two methods called when left is about to show or hide to set userInteractionEnabled to NO or YES on the main view.

2) PBRevealViewController do not provide a pan gesture for close left or right view. Only tap.

Health-Appoinment1.zip

alisattar456 commented 7 years ago

Thanks Very Much