In iOS, programmatically, how can one find what top most UIView is?
In other words .. what view is displayed right now?
Say, i have a nib with 3 views stacked on top of one another. Inside a program, i can remove the top view if I know what it is. How can i find out what view is on top of the nib?
You can have a lot of top most views because a view doesn’t have to take all the screen.
If you want the top most subview of a view, you can call
and take tje last one (they are in displayed order, most front last)
edit: this is better (from comments)
If you know your displayed viewController just replace yourView by yourController.view