Skip to content

Instantly share code, notes, and snippets.

@samuelbeek
Created November 18, 2015 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelbeek/57901d05c7c23428f409 to your computer and use it in GitHub Desktop.
Save samuelbeek/57901d05c7c23428f409 to your computer and use it in GitHub Desktop.
Device distriction in Swift
//
// 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