zbz.lvlv zbz.lvlv - 1 year ago 69
iOS Question

SpriteKit how to get correct screen size

I've tried


None of them work.

How do I get the correct screen size for the device?

Answer Source

You can use following swift code to get the screen size.

let displaySize: CGRect = UIScreen.mainScreen().bounds
let displayWidth = displaySize.width
let displayHeight = displaySize.height
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download