In addition, you can check for UINavigationController and ask for its topViewController or even check for UITabBarController and ask for selectedViewController . This will get you the view controller that is currently visible to the user.
Read moreHow do I view ViewController?
To present ViewController which works with XIB file you can use the following example:
Read more