If you want the perceive the top view controller object from your application, then use the below code. The code sample is a category to the UIApplication.