Access UIView width at runtime
Just one thing about these fields:
self.view1.frame.size.width
self.view1.frame.size.height
Are only actual user device size if the view has been drawn to screen, else they are what ever you set them as in the storyboard. So if your trying to perform some kind of calculation before the view is drawn you will have to figure out the width or height another way!
Add this and you are good to go:
override func viewDidLayoutSubviews() {
println(self.view1.frame.size)
}
you can look at width or height as you please.
you can only use this
self.view1.frame.size.width
self.view1.frame.size.height