Skip to content

Instantly share code, notes, and snippets.

@mushu8
Created April 25, 2016 19:04
Show Gist options
  • Save mushu8/7efec1e39bdf3329c65739073ecc3d39 to your computer and use it in GitHub Desktop.
Save mushu8/7efec1e39bdf3329c65739073ecc3d39 to your computer and use it in GitHub Desktop.
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
}
}
@mushu8
Copy link
Author

mushu8 commented Apr 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment