In Swift, how do I get the width (or height) at runtime, of a UIView that\'s created programmatically using auto layout constraints?
I\'ve tried view1.frame.size.
view1.frame.size.
Frame width and height returns zero because at the time you called that function inside of viewDidLoad it is not yet sized properly. You can use viewDidAppear to call your necessary functions