Many times we need to make check for iOS version as it Apple changes its API from version to version. For this reason Apple provide the safest way to achieve it, which is "NSFoundationVersionNumber". It returns on which version device is running. It provide ENUM for it which is used to make check as follows (In this example we are checking for iOS8):
BOOL iOS8 = (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) ? YES : NO;
As simple as that. Also ENUM for NSFoundationVersionNumber has values for iOS, iPhoneOS and MAC OS as well.
0 Comment(s)