Flip animation when controller pushed on iPhone

前端 未结 4 738
失恋的感觉
失恋的感觉 2020-12-23 23:36

I had a look around and didn\'t find what I was exactly looking for.

Is there a way to get a flip animation when pushing a view controller?

I read that you c

4条回答
  •  囚心锁ツ
    2020-12-24 00:21

    This also works.. for iOS 4.0 and greater

    [UIView  transitionWithView:self.navigationController.view duration:0.8  options:UIViewAnimationOptionTransitionFlipFromLeft
                                 animations:^(void) {
                                     BOOL oldState = [UIView areAnimationsEnabled];
                                     [UIView setAnimationsEnabled:NO];
                                     [self.navigationController pushViewController:viewController animated:YES];
                                     [UIView setAnimationsEnabled:oldState];
                                 }
                                 completion:nil];
    

提交回复
热议问题