Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check the device is iPhone 5? [duplicate]

Tags:

ios

iphone

How can I check if an application running on iPhone 5 or not and then do something?

like image 611
iWizard Avatar asked Nov 05 '12 21:11

iWizard


People also ask

How can I know my iPhone is original or duplicate?

Check the IMEI number So, this is one of the easiest ways to find out if your iPhone is real or fake. To find the phones IMEI number go to Settings, click on General, tap on the About option, and scroll down to see the IMEI number. If theres no IMEI or serial number, theres a high chance that the iPhone model is fake.

Does iPhone 5 have tracking?

The iPhone 4, 4s, 5 and 5c cannot connect as your step tracking device because these models don't have the part built in, the accelerometer, that tracks steps (this is included in the iPhone5s and newer).

How do I know if my phone is linked to another device iPhone?

From the Devices section of your Apple ID account page, you can see all of the devices that you're currently signed in to with your Apple ID, including Android devices, consoles, and smart TVs: Sign in to appleid.apple.com,* then select Devices.


2 Answers

#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

then in the code:

if (IS_IPHONE_5) { 
   //is iphone 5
}
like image 78
Piero Avatar answered Oct 01 '22 01:10

Piero


You're likely concerned with the window size, not the make/model, this will do:

CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
if (screenRect.size.height == 568)
{
 // this is an iPhone 5+
}
like image 28
CSmith Avatar answered Oct 01 '22 01:10

CSmith