mutualmobile / MMDrawerController

A lightweight, easy to use, Side Drawer Navigation Controller
MIT License
6.76k stars 1.38k forks source link

Status bar animation not working #411

Open Ricardo1980 opened 8 years ago

Ricardo1980 commented 8 years ago

It seems setOpenSide is called in the completation block of openDrawerSide and closeDrawerAnimated, and it calls setNeedsStatusBarAppearanceUpdate without animation, but openDrawerSide/closeDrawerAnimated try to do it. A fast workaround is to modify setOpenSide in this way, just adding an animation to setNeedsStatusBarAppearanceUpdate:

-(void)setOpenSide:(MMDrawerSide)openSide{
    if(_openSide != openSide){
        _openSide = openSide;
        [self.centerContainerView setOpenSide:openSide];
        if(openSide == MMDrawerSideNone){
            [self.leftDrawerViewController.view setHidden:YES];
            [self.rightDrawerViewController.view setHidden:YES];
        }
        [UIView animateWithDuration:0.3 animations:^{
            [self setNeedsStatusBarAppearanceUpdate];
        }];

    }
}

Of course this is not a solution because animation should be launch from openDrawerSide/closeDrawerAnimated using the duration parameter properly.

thomasbaldwin commented 8 years ago

@Ricardo1980 are you referring to animating the status bar with the center view controller as you open and close the slide out menu?