Created
March 15, 2017 18:33
-
-
Save hcn1519/4b61e7a2df00ddda7e92ee8c70e84660 to your computer and use it in GitHub Desktop.
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
// ScreenExtesion.swift | |
import UIKit | |
extension UIDevice { | |
public var isiPhoneSE: Bool { | |
if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.phone && (UIScreen.main.bounds.size.height == 568 || UIScreen.main.bounds.size.width == 320) { | |
return true | |
} | |
return false | |
} | |
public var isiPhonePlus: Bool { | |
if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.phone && (UIScreen.main.bounds.size.height == 736 || UIScreen.main.bounds.size.width == 414) { | |
return true | |
} | |
return false | |
} | |
public var isiPad: Bool { | |
if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad && (UIScreen.main.bounds.size.height == 1024 || UIScreen.main.bounds.size.width == 768) { | |
return true | |
} | |
return false | |
} | |
public var isiPadPro12: Bool { | |
if UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad && (UIScreen.main.bounds.size.height == 1366 || UIScreen.main.bounds.size.width == 1366) { | |
return true | |
} | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment