Good day,
I’m currently playing around with the App Architecture of Chapter 24.
Just wondering why programmatic UIViewController and NSLayoutConstraint.activate doesn’t work?
extension Scene {
func viewController() -> UIViewController {
switch self {
case .books(let viewModel):
var vc = BookListViewController()
vc.view.backgroundColor = .white
vc.bindViewModel(to: viewModel)
let nc = UINavigationController(rootViewController: vc)
return nc
}
}
}
I’ve tried activating the constraints in viewDidLoad and viewDidLayoutSubviews, but for some reason the controls all end up underneath the UINavigationBar?
Why would this happen?