Skip to content

Instantly share code, notes, and snippets.

@greenfrvr
Last active June 3, 2019 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenfrvr/f39a51a331403db7e388c09f55f0f588 to your computer and use it in GitHub Desktop.
Save greenfrvr/f39a51a331403db7e388c09f55f0f588 to your computer and use it in GitHub Desktop.
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