Created
November 2, 2017 07:39
-
-
Save PtitChevreuil/94f2400f217c22290a86b6c63c0ad6df 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
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