Created
April 25, 2016 19:04
-
-
Save mushu8/7efec1e39bdf3329c65739073ecc3d39 to your computer and use it in GitHub Desktop.
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
extension UIScreen { | |
enum SizeType: CGFloat { | |
case Unknown = 0.0 | |
case iPhone4 = 960.0 | |
case iPhone5 = 1136.0 | |
case iPhone6 = 1334.0 | |
case iPhone6Plus = 1920.0 | |
} | |
var sizeType: SizeType { | |
let height = nativeBounds.height | |
guard let sizeType = SizeType(rawValue: height) else { return .Unknown } | |
return sizeType | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions