Created
November 18, 2015 10:27
-
-
Save samuelbeek/57901d05c7c23428f409 to your computer and use it in GitHub Desktop.
Device distriction in 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
// | |
// DeviceHelpers.swift | |
// | |
// Created by Samuel Beek on 08/10/15. | |
// Copyright © 2015 Samue Beek. All rights reserved. | |
// | |
import UIKit | |
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 | |
static let small = !iPhone6 && !iPhone6plus | |
static let big = !iPhone4 && !iPhone5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment