Last active
July 9, 2016 12:06
-
-
Save r-dent/6956c825bc1f1e57460c to your computer and use it in GitHub Desktop.
iOS Constants Swift
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
let IS_iOS_7 = UIDevice.currentDevice().systemVersion.hasPrefix("7") | |
let IS_iOS_8 = UIDevice.currentDevice().systemVersion.hasPrefix("8") | |
let IS_iPad = UI_USER_INTERFACE_IDIOM() == .Pad | |
let IS_IPHONE = UI_USER_INTERFACE_IDIOM() == .Phone | |
let IS_IPHONE_4S_AND_LOWER (IS_IPHONE && max(UIScreen.mainScreen().bounds.size.height, UIScreen.mainScreen().bounds.size.width) == 480.0) | |
let IS_IPHONE_5 = (IS_IPHONE && max(UIScreen.mainScreen().bounds.size.height, UIScreen.mainScreen().bounds.size.width) == 568.0) | |
let IS_iPhone6 = (IS_IPHONE && max(UIScreen.mainScreen().bounds.size.height, UIScreen.mainScreen().bounds.size.width) == 667) | |
let IS_iPhone6Plus = (IS_IPHONE && max(UIScreen.mainScreen().bounds.size.height, UIScreen.mainScreen().bounds.size.width) == 736) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment