M字ハゲ系が出てきてから、端末によってステータスバーの高さが変わるようになった。
ステータスバーの高さを取得する方法
以下のようにするとステータスバーの高さを取得できる。
let statusBarHeight = UIApplication.shared.statusBarFrame.height
ステータスバーのサイズ一覧
ちなみに、ステータスバーの高さは以下
| 機種 | ステータスバー高さ |
|---|---|
| iPhone12 Mini | 44 |
| iPhone12 | 47 |
| iPhone12 Pro | 47 |
| iPhone12 Pro Max | 47 |
| iPhone11 | 48 |
| iPhone11 Pro | 44 |
| iPhone11 Pro Max | 44 |
| iPhoneX | 44 |
| iPhoneXR | 44 |
| iPhoneXS | 44 |
| iPhoneXS Max | 44 |
| iPhoneSE | 20 |
| iPhone8 | 20 |
| iPhone8 Plus | 20 |
参考文献

