0

Possible Duplicate:
Check iPhone iOS Version

I am trying to setup some code that is different on iOS 5.0.1 than it is one iOS 5.1 and higher. Is there an if statement to determine it or not?

Community
  • 1
  • 1
user717452
  • 2,419
  • 14
  • 73
  • 146
  • Here you can get all info related to device over here https://github.com/aleemrazzaq/ARCompactDeviceInfo – Aleem Mar 29 '18 at 13:28

2 Answers2

0
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
shabbirv
  • 8,818
  • 3
  • 32
  • 34
0
   if ( [[[UIDevice currentDevice] systemVersion] floatValue] == 5.0)
{
// Do something
}


else if ( [[[UIDevice currentDevice] systemVersion] floatValue] == 5.1)
{
// Do something
}
else
{
// Do something
}
iArezki
  • 1,263
  • 2
  • 16
  • 29
  • This is wrong for reasons outlined in comments to http://stackoverflow.com/a/3341214/118721 (see the accepted answer there for a correct solution). – yakovlev Aug 22 '12 at 21:15