To get the direct value in Int, use this code
var bounds: CGRect = UIScreen.mainScreen().bounds var w:Int = Int(self.bounds.size.width) var h:Int = Int(self.bounds.size.height)
All you have to do is convert the return value from CGFloat to Integer
Use the following code to get the screen height width value and then convert CGFloat to Int
var bounds: CGRect = UIScreen.mainScreen().bounds var width:CGFloat = bounds.size.width var height:CGFloat = bounds.size.height
Fatti khan
source share