今回もSwift
の超短い小ネタです👷♀️
結論
iOS11
以降からは、下記のようにUIView
のsafeAreaInsets
からSafeArea
の幅等を取得することができます。
UIApplication.shared.windows.filter { $0.isKeyWindow }.first?.safeAreaInsets.top ?? 0
てな感じで本日は以上になります🍺
今回もSwift
の超短い小ネタです👷♀️
iOS11
以降からは、下記のようにUIView
のsafeAreaInsets
からSafeArea
の幅等を取得することができます。
UIApplication.shared.windows.filter { $0.isKeyWindow }.first?.safeAreaInsets.top ?? 0
てな感じで本日は以上になります🍺