I just start to study swift, and when I use Cartography to autolayout views, I have a problem. Here is what happens.
I create a LoginViewController, put all the constrains in a function named "updateConstrains()", and called in the override func viewDidLoad(). If I set the LoginViewController as the window rootViewController in AppDelegate, it works well.
But if I put the LoginViewController as the rootViewController of a UINavigationController as follows:
window!.rootViewController = UINavigationController(rootViewController: loginViewController)
It become like this:
and when print the width and height of the LoginViewController's view. It turns out that:
width = 155, height = 0.
Can anyone tell me what happens?