As far as I know, this would work in Objective-C:
self.window.rootViewController.class == myViewController
How can I check if the current v
Updated for swift3 compiler throwing a fit around ! and ?
if let wd = UIApplication.shared.delegate?.window { var vc = wd!.rootViewController if(vc is UINavigationController){ vc = (vc as! UINavigationController).visibleViewController } if(vc is LogInViewController){ //your code } }