Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在SceneDelegate.swift中做rootViewController操作后,返回按钮的响应无法返回 #9

Open
XWXGitHub opened this issue Apr 14, 2020 · 0 comments

Comments

@XWXGitHub
Copy link

XWXGitHub commented Apr 14, 2020

class func currentViewController() -> UIViewController {
    if let rootVC = UIApplication.shared.delegate?.window??.rootViewController {
        return self.currentViewController(from: rootVC)
    } else {
        return UIViewController()
    }
}

在控制台打印了下结果如下

if let rootVC = UIApplication.shared.delegate?.window??.rootViewController
p  rootVC
(UIViewController?) $R0 = nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant