LoginSignup
0
2

Swiftで画面の縦幅・横幅を取得するプログラム

Last updated at Posted at 2021-04-19

Swiftで画面の縦幅・横幅を取得するプログラムをメモとして残しておきます。

//横幅を取得
let screenWidth = UIScreen.main.bounds.size.width
//縦幅を取得
let screenHeight = UIScreen.main.bounds.size.height

iPhoneの画面サイズごとに処理を分けたい時などは各コードを使ってif文で条件分岐をすると便利

Swiftのお役立ち情報

0
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2