I can\'t seem to get the top most UIViewController without access to a UINavigationController. Here is what I have so far:
UIApplic
Use this code to find top most UIViewController
func getTopViewController() -> UIViewController? {
var topController: UIViewController? = UIApplication.shared.keyWindow?.rootViewController
while topController?.presentedViewController != nil {
topController = topController?.presentedViewController
}
return topController
}