yicr
2/2/2020 - 7:57 AM

iOS : Tips / How to get screen size.

スクリーンサイズを取得する。

for Swift 4.x or later

let screenSize: CGRect = UIScreen.main.bounds

for Swift 3.x

let screenSize: CGRect = UIScreen.mainScreen().bounds