Checking device or system version.
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.