zetachang / DCModalSegue

A custom segue which makes a pushed back modal presenting animation.
MIT License
319 stars 23 forks source link

Does not work on iOS8 #10

Open jerometonnelier opened 10 years ago

jerometonnelier commented 10 years ago

When calling the presentViewController in the viewDidLoad

  [UIView animateWithDuration:kModalSeguePushedBackAnimationDuration delay:0.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
 self.screenshot.alpha = 0.7;
 } completion:^(BOOL finished) {
 [self presentViewController:self.destinationController animated:YES completion:nil];
 }];

I get the error message

  Attempt to present <StatusViewController: 0x7fa744534b90> on <DrawerViewController: 0x7fa7416283e0> while a presentation is in progress!

Any idea? Thx ;)

jerometonnelier commented 10 years ago

If I move the code into viewDidAppear, I still get the error message but it is working. Weird ?

zetachang commented 10 years ago

Actually, presenting another view controller in viewDidLoad will break even a simple built-in present style UIModalPresentationStyle. So put code in viewDidAppear is the correct way.