I am trying to access view.frame.size.height and view.frame.size.width outside a function, and I am not able to. Is there any workaround for this?
I tried doing this, but it did not work-
var screenBound = UIScreen.mainScreen().bounds
var screenSize = screenBound.size
var screenWidth = screenSize.width
var screenHeight = screenSize.height
Xcode gave me an error- Instance member 'screenbound' cannot be used on type 'ViewController'
I can only use self.view.frame.size.height/.width inside a created function. But I want to use it outside a function. Thanks in advance.