In Objective-C we can get device width and height by using following code :
CGRect sizeRect = [UIScreen mainScreen].applicationFrame float width = sizeRect.
While @Adam Smaka's answer was close, in Swift 3 it is the following:
let screenBounds = UIScreen.main.bounds let width = screenBounds.width let height = screenBounds.height