Hi i would like to check iPhone Device Version in iOS.
I mean , currently running device is iPhone 4 or iPhone 5.
I need to check the device , is that iPhone 5 or not?
Because i have some problem in my app that need to know iPhone 5 or not.
So how can i?
I actually found a #define that does the trick
Add this code:
Add This Macros to your code:
then just check whenever you needs..
Based on the answers of this question you could determined which model your are using by this:
Results can be one of the values: iPod touch, iPhone, iPad, iPhone Simulator, iPad Simulator
For specific model which version you are using could be determined by creating a Category on
UIDevice.h
class like this:UIDevice+Utilities.h
UIDevice+Utilities.m
Example how to call function
deviceModelVersion
:Possible results could be 1.0, 1.1, ..., 2.0, 2.1, ..., 3.0, 3.1, .., 4.0, 4.1, .., 5.0, 5.1, ...
To determine if it is iPhone 5, you would have
and