fileprivate func test() {
guard let w = self.view.window else {
print("no window")
return
}
guard let rootvc = w.rootViewController as? UINavigationController else {
print("no rootvc")
return
}
for vc in rootvc.childViewControllers {
print("CHILD \(vc)")
}
for vc in rootvc.viewControllers {
print("VC \(vc)")
}
}
the code above shows the same. But whats the difference between childViewControllers
and viewControllers
?