Disabling multiple modal controllers in iOS 5

iPhone ModalViewController . In iOS 4, you can reject multiple ModalViewControllers using:

[[[[self parentViewController] parentViewController] parentViewController] dismissModalViewControllerAnimated:YES]; 

In iOS 5, the code does not work.

How to disable multiple modalViewControllers in iOS 5?

+4
source share
2 answers

Yes, this is an annoying change. for modal view managers, now you need to call presentingViewController instead of parentViewController

+6
source

Hi In iOS 5 Use the code below

 [[[self presentingViewController] presentingViewController] dismissModalViewControllerAnimated:YES]; 
0
source

Source: https://habr.com/ru/post/1388242/


All Articles