Skip to content

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

Description

@XWXGitHub
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions