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

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

Open
yanghl opened this issue Aug 7, 2020 · 2 comments

Comments

@yanghl
Copy link

yanghl commented Aug 7, 2020

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

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

@CoderMaurice
Copy link

遇到同样的问题,有解决方案吗?

@szweee
Copy link

szweee commented Mar 14, 2021

我也遇到了,我自己修改了这个topMost方法就好了

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

3 participants