import Foundation
import UIKit
// UIDevice 익스텐션으로 만들어줍니다.
extension UIDevice {
var hasNotch: Bool {
let scenes = UIApplication.shared.connectedScenes
let windowScenes = scenes.first as? UIWindowScene
let window = windowScenes?.windows
let bottom = window?.filter {$0.isKeyWindow}.first?.safeAreaInsets.bottom ?? 0
return bottom > 0
}
}
SomeView().background(UIDevice.current.hasNotch ? Color.red : Color.yellow)