2018-07-05

关于whose view is not in the window hierarchy错误的解决方法

func topMostController() -> UIViewController {
    var topController = UIApplication.shared.keyWindow?.rootViewController
    while ((topController?.presentedViewController) != nil) {
        topController = topController?.presentedViewController
    }
    return topController!
}

你可能感兴趣的:(2018-07-05)