2014 February

Checking device or system version.

February 3rd, 2014 posted in Apps Developement Objective-C

Sometimes you need to check the system version, because some a newer version of the SDK adds new methods or worse deprecates one in favour of a new one. I often see example like this one:

if ([[[UIDevice currentDevice]systemVersion]floatValue]<5.0) {
   [self presentModalViewController:errorView animated:YES];
} else {
   [self presentViewController:errorView animated:YES completion:nil];
}

In this example you’ll see that the system version is casted to a float and checked where it is lower than 5.0.

Read the rest of this entry »