Swiftで画面の縦幅・横幅を取得するプログラムをメモとして残しておきます。
//横幅を取得 let screenWidth = UIScreen.main.bounds.size.width //縦幅を取得 let screenHeight = UIScreen.main.bounds.size.height
iPhoneの画面サイズごとに処理を分けたい時などは各コードを使ってif文で条件分岐をすると便利
Register as a new user and use Qiita more conveniently