Created
October 8, 2015 10:46
-
-
Save samuelbeek/043865c30802ff672eb8 to your computer and use it in GitHub Desktop.
detect iOS devices
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
// example if(Devices.iPhone4) { view.alpha = 0 } | |
struct Devices { | |
static let iPhone4 = UIScreen.mainScreen().bounds.size.height == 480.0 | |
static let iPhone5 = UIScreen.mainScreen().bounds.size.height == 568.0 | |
static let iPhone6 = UIScreen.mainScreen().bounds.size.height == 667.0 | |
static let iPhone6plus = UIScreen.mainScreen().bounds.size.height == 736.0 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment