When I write like this, it works as expected:
override func viewDidLoad() {
super.viewDidLoad()
MBProgressHUD.showAdded(to: navigationController!.view, animated: true)
}
However, when I put it in the DispatchQueue.main block, the hud does not show:
override func viewDidLoad() {
super.viewDidLoad()
DispatchQueue.main.async {
MBProgressHUD.showAdded(to: self.navigationController!.view, animated: true)
}
}
I am debugging the view hierarchy, and there is a problem with the layout:
"Position and size are ambiguous for MBProgressHUD"
NavigationController is a childViewController from fatherViewController, and the container view is set automatically by the location in fatherViewController.
This is problem?
a_tuo source
share