0

This issue only occurs on iPhone 5, regardless of iOS version.

  1. I present the secondViewController from the firstViewController it is presented this time.
  2. I then dismiss the secondViewController.
  3. I attempt to present the secondViewController again from the firstViewController, this time it isn't presented but the UI is blocked,

From logging the process I can see that viewWillAppear method is called the first time but not the second time.

FirstViewController

- (void)presentView {
    SecondViewController *secondViewController = [[SecondViewController alloc] init];
    secondViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentViewController:secondViewController animated:YES completion:nil];
}

SecondViewController

- (void)dismissView {
    [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
}
Sami
  • 1,374
  • 1
  • 16
  • 43
  • You should use `[self dismissViewControllerAnimated:YES completion:nil];` from second view controller to dismiss itself. What you have written would not really work. – dispatchMain Mar 31 '16 at 10:02
  • @Ad-J I've tried that too, has the same issue – Sami Mar 31 '16 at 10:07
  • What I suggested is not a solution to what you are asking. I merely suggested how you should dismiss your view controller from same class. As of question, I dont really understand your question. Can you rephrase it make it more clear? – dispatchMain Mar 31 '16 at 10:11
  • @Ad-J rephrased the question – Sami Mar 31 '16 at 10:17
  • I think It is not presenting it second time because you are dismissing it and presenting it again immediately and both animations are overlapping. You can not have two present and dismiss animations at same time. Can you try to have a small gap between dismissing the first time and presenting second time? – dispatchMain Mar 31 '16 at 10:20
  • @Ad-J sorry should have said, I'm presenting the secondViewController form a button tap – Sami Mar 31 '16 at 10:22
  • Then I think we are missing some more info here. Could you try and explain the whole scenario here along with all relevant code? – dispatchMain Mar 31 '16 at 10:33
  • @Ad-J this is the whole scenario, it seems to be a bug only on the iPhone 5 though, regardless of iOS version, I've tested on 5s, 6, 6+ with multiple iOS versions but can't replicate issue on this devices – Sami Mar 31 '16 at 10:36
  • Are you using storyboard? If so, is the secondViewController visible on the storyboard? - Also why are you creating SViewController for 'SecondViewController'? Should these both not be the same? – Jim Tierney Mar 31 '16 at 10:40
  • I just created a sample app for the same and it works fine on all devices. Only difference is that I have controllers in storyboard and I use `[self dismissViewControllerAnimated:YES completion:nil];` in second view controller on button tap to dismiss itself. – dispatchMain Mar 31 '16 at 10:49
  • @JimTierney not using storyboard, and yeah sorry typo – Sami Mar 31 '16 at 12:54
  • @Ad-J I'm not using storyboard but I am no using [self dismissViewControllerAnimated:YES completion:nil]; still the same problem – Sami Mar 31 '16 at 12:55

0 Answers0