swift has Top Notch
extension UIDevice {
/// Returns `true` if the device has a notch
var hasNotch: Bool {
guard #available(iOS 11.0, *), let window = UIApplication.shared.windows.filter({$0.isKeyWindow}).first else { return false }
if UIDevice.current.orientation.isPortrait {
return window.safeAreaInsets.top >= 44
} else {
return window.safeAreaInsets.left > 0 || window.safeAreaInsets.right > 0
}
}
}
Also in Swift:
- swift xcode debug cannot see code backtrace
- loop backwards swift
- show alert swiftui
- swift toggle on change
- swift pop to specific view controller
- get length of array swift
- register page
- swift get current hour
- fnb swift code
- blur background swiftui
- swift
- swift how to wait in a loop
- remove padding hstack swiftui
- swift change background color
- meu eclipse não gera a implementação do mapstruct
- rxswift map
- Make a VStack fill the width of the screen in SwiftUI
- swift set constraint programmatically
- dequeueReusableCellWithIdentifier returns nil
- Close iOS Keyboard by touching anywhere using Swift
- settimeout in swift
- check when webview finish loading swift
- swift convert decimal to string
- tellraw minecraft