Created
September 22, 2017 05:10
-
-
Save MTattin/7337193398986eb3f9c48261858fa612 to your computer and use it in GitHub Desktop.
safeAreaInsets.top と status bar のメモ ref: http://qiita.com/MTattin/items/224746049bbd849c49f4
This file contains hidden or 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
/// | |
/// Safe Area Insets | |
/// | |
var SAFE: UIEdgeInsets { | |
get { | |
if #available(iOS 11.0, *) { | |
if let insets = AppDelegate?.window?.safeAreaInsets { | |
return insets | |
} | |
} | |
return UIEdgeInsets.zero | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment