I have this ad class which contains an UIImageView. I’ve added an instance of the class to my appdelegate onto the “window” view.
Now, I want to, when the user taps the ad, push my “detailedViewController” onto the current navigation controller, which all of my tab bar items contain. I don’t know if it is possible.
Perhaps, I should just add my advertisement class to every view controller for every nav controller. However, if the user pushes or changes a view controller it would reset the class.
I just want to overlay the ad once.
EDIT:
Let me rephrase, can I from the app delegate and from my object know which tab bar item is selected? If I can determine which tab bar item is selected I can point to the appropriate nav controller instance.
The easyiest way would be to present your DetailVC as a ModalView which also makes sense in semantics.
Yes, it is possible to detect which tab is selected but it is easier to use the
selectedViewController-property ofUITabBarController.