知らなかったのでメモ。
画面の向きにかかわらず、いつでもportrait時のboundsが取得できるプロパティ。
nativeBounds - UIScreen | Apple Developer Documentation
例)portraitだけではなくlandscapeにもなるiPadアプリで、スクリーンの高さによって制約を変えたいときのコード
switch (UIScreen.main.nativeBounds.height) {
case 2048: // 9.7インチ
viewWidthConstraint.constant = 768
case 2224: // 10.5インチ
viewWidthConstraint.constant = 834
case 2732: // 12.9インチ
viewWidthConstraint.constant = 1024
default:
viewWidthConstraint.constant = 768
}