Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

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
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: swift first where 
Swift :: ui alert swift yes no 
Swift :: Unique device id ios swift 
Swift :: cannot assign IBaction to uiimageview 
Swift :: play sound swift stack overflow 
Swift :: swift rotate text 90 degrees 
Swift :: swft imageä 
Swift :: date formatter swift 
Swift :: get request swift 
Swift :: core data fetch request 
Swift :: white or light ASAuthorizationAppleIDButton “Sign in with Apple” button - Swift 
Swift :: UICollectionView current visible cell index 
Swift :: xcode disable a button 
Swift :: swiftui circle 
Swift :: swift for loop 
Swift :: swift collection view check if you are at the bottom 
Swift :: swift ui enum 
Swift :: tableview cell animation swift 
Swift :: swift hex color 
Swift :: add navigation bar button swiftui 
Swift :: uiview set inside padding 
Swift :: swift pdf preview image 
Swift :: how can i find range of a string in another string swift 
Swift :: accessing tab bar item action swift 
Swift :: swift replace newlines with space 
Swift :: swift get keys from dictionary 
Swift :: how to send a file from file manager in mail swift 
Swift :: Swift for Loop with where Clause 
Swift :: Swift Operators 
Swift :: separator style swiftui list 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =