Last active
June 3, 2019 18:14
-
-
Save greenfrvr/f39a51a331403db7e388c09f55f0f588 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func convertToWindowInsetsMap(insets: UIEdgeInsets) -> [String: Any] { | |
return [ | |
"leftInset": insets.left, | |
"rightInset": insets.right, | |
"topInset": insets.top, | |
"bottomInset": insets.bottom, | |
"hasNotch": insets.bottom > 0 | |
] | |
} | |
//iOS <11 | |
private func convertToWindowInsetsMap(statusBarFrame frame: CGRect) -> [String: Any] { | |
return [ | |
"leftInset": 0, | |
"rightInset": 0, | |
"topInset": frame.height, | |
"bottomInset": 0, | |
"hasNotch": false | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment