Skip to content

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

@XWXGitHub

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

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