How do I get all apps ViewControllers in iOS?
Interaction with Umka's answer.
Not knowing exactly what you want to do this can be completely overwhelming, but it might help you.
You can subclass UIViewController (like AddToArrayViewController) and in your custom initialization method add it to some kind of Singleton that you defined somewhere. This way, whenever you initialize the ViewController (which is a subclass of your AddToArrayViewController), it will be added to the array in your Singleton.
BUT, you need to make sure that you also remove the ViewControllers when they are removed / cleared, otherwise you will only have a list of dangling pointers in that array, which is not very safe.
source to share
AFAIK there is no such way unless you take care of yourself. You can have access to all navigation controllers, but they will only contain the currently initialized controllers on the stack. There are always controllers that are not part of any navi, like modal view controllers. I would say that you are doing something wrong if you need it :)
Perhaps the only way to do this is to keep everything in an array that you have complete control over.
source to share