As far as I know, this would work in Objective-C:
self.window.rootViewController.class == myViewController
How can I check if the current v
Swift 4, Swift 5
let viewController = UIApplication.shared.keyWindow?.rootViewController if viewController is MyViewController { }