4

Popping to a controller and calling the reenteringViewController method show below after view will appear ignores the preferredStatusBarUpdateAnimation set in the view controller and instead uses a Slide Animation (which was used previously in the old controller though is set to fade before popping to the current controller).

-(void)reenteringViewController{

  [UIView animateWithDuration:0.7 delay:0 options:UIViewAnimationOptionCurveEaseInOut  animations:^
 {

     if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
         [self prefersStatusBarHidden];
         [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate) withObject:nil];

     }

 }


                 completion:^(BOOL finished){

                 }];
}



- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation{

    return UIStatusBarAnimationFade;

}

-(BOOL)prefersStatusBarHidden{

    return NO;
}

Has anyone experienced this before and if so if they found a solution? I've spent hours pouring over the code but it's very simple and all seems to be calling things correctly but just doesn't use the correct animation. Seems like it could be an iOS7 bug.

I appreciate your help in advance.

JapanDev
  • 341
  • 2
  • 12
  • When you have the getter overridden like that, whatever value you set with the setter is not used. – A-Live May 23 '14 at 11:36

0 Answers0