Xcode: When is a View Controller added to the stack of views?
-
10-07-2019 - |
Question
Is a view controller added to the stack of view controllers at the #import line of the root view controller? Is this where indexPath gets the info about the view controllers?
I've read documentation and seen tutorials, but this aspect still isn't clear to me. I'm been learning Xcode/Obj-C for 4 months now.
Thanks, Steve
Solution
Assuming you are using a UINavigationController
, it is added to the stack when you call pushViewController:
.
The #import
statement is pure syntax, and helps the compiler find the definitions it needs to properly compile your code.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow