if UIDevice.currentDevice().userInterfaceIdiom == .Pad
{
self.label.text = "iPad"
}
else
{
var detectionSIze : CGFloat = 0
if UIDevice.currentDevice().orientation == .Portrait
{
detectionSIze = self.view.bounds.height
}
else
{
detectionSIze = self.view.bounds.width
}
switch self.view.bounds.height
{
case 480:
self.label.text = "iPhone 4S"
case 568:
self.label.text = "iPhone 5 /5S"
case 667:
self.label.text = "iPhone 6"
case 736:
self.label.text = "iPhone 6 Plus"
default:
self.label.text = "iPhone"
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.