I want to check if the iOS
version of the device is greater than 3.1.3
I tried things like:
[[UIDevice currentDevice].systemVersion
There are version like 7.0 or 6.0.3, so we can simply convert version into numerics to compare. if version is like 7.0, simply append another ".0" to it and then take its numeric value.
int version;
NSString* iosVersion=[[UIDevice currentDevice] systemVersion];
NSArray* components=[iosVersion componentsSeparatedByString:@"."];
if ([components count]==2) {
iosVersion=[NSString stringWithFormat:@"%@.0",iosVersion];
}
iosVersion=[iosVersion stringByReplacingOccurrencesOfString:@"." withString:@""];
version=[iosVersion integerValue];
For 6.0.0
if (version==600) {
// Do something
}
for 7.0
if (version==700) {
// Do something
}