Search code examples
iosios7rubymotion

PKRevealController dim the hidden controller


Does anyone has an idea if PKRevealController has a method to add an overlay (dim) effect to the hidden controller when the right/left view slides in ?

https://github.com/pkluz/PKRevealController


Solution

  • Like I saw inside the example code, you can check which kind of state you have for a specific UIViewController. Can't you add a new UIView make it black with alpha:0.6 and set it hidden. If the UIViewController did change to the state in background, animate the hidden View like

    [UIView animateWithDuration:0.5 animations:^{
        [OverlayView setHidden:NO];
    }];
    

    Inside viewDidAppear you can check if your OverlayView is hidden:YES and animate it to NO.