Skip to content

Instantly share code, notes, and snippets.

@PtitChevreuil
Created November 2, 2017 07:39
Show Gist options
  • Save PtitChevreuil/94f2400f217c22290a86b6c63c0ad6df to your computer and use it in GitHub Desktop.
Save PtitChevreuil/94f2400f217c22290a86b6c63c0ad6df to your computer and use it in GitHub Desktop.
extension UIViewController {
var compatibleSafeInsets: UIEdgeInsets {
if #available(iOS 11, *) {
return view.safeAreaInsets
} else {
return UIEdgeInsetsMake(topLayoutGuide.length, 0, bottomLayoutGuide.length, 0)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment