Skip to content

如果主控制器有子控制器,子控制器没有加到父控制器 获取不到 navigationcontroller #146

@yanghl

Description

@yanghl

topMost 方法 最后一个判断 子控制器没有导航控制器 ,而子控制器又没有加入到父控制器的addChild方法 就导致获取不到导航控制器

for subview in viewController?.view?.subviews ?? [] {
if let childViewController = subview.next as? UIViewController {
//以下可能返回nil
return self.topMost(of: childViewController)
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions