ios - How to determine which view controller is currently active/the one displaying a view? -


in app queueing local notifications, when fire must present modal view. trouble have numerous view controllers 1 of active , 1 needs present modal view controller. how can determine 1 in use?

i setting navigation controller windows root view controller, , can push number of other view controllers, of them may presenting view controller modally. must work on ios 4 , 5.

i have lot of view controllers avoid putting code in each of them each check if top one.

you can @ navigation controller's topviewcontroller property find out controller @ top of stack. 1 view displayed.

since may presenting modal view controller, you'll more interested in visibleviewcontroller property, give controller current view whether presented modally or pushed onto navigation stack.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -