May 25, 2014

[iOS] detected iOS 5, 6 & 7

Find version iOS, use function [UIDevice currentDevicesystemVersion] 
____________________________________________________________

+ (BOOL) isIOS7
{
    NSString *version = [[UIDevice currentDevice] systemVersion];
    if ([version floatValue] >= 7.0) {
        return YES;
    }else {
        return NO;
    }
}

____________________________________________________________

+ (BOOL) isIOS6
{
    NSString *version = [[UIDevice currentDevice] systemVersion];
    if ([version floatValue] >= 6.0 && [version floatValue] < 7.0) {
        return YES;
    }else {
        return NO;
    }
}

____________________________________________________________


+ (BOOL) isIOS5
{
    NSString *version = [[UIDevice currentDevice] systemVersion];
    if ([version floatValue] >= 5.0 && [version floatValue] < 6.0) {
        return YES;
    }else {
        return NO;
    }
}

No comments:

Post a Comment