@interface DeviceUtil : NSObject {
}
+(BOOL)osVersionSupported:(NSString*)version;
@end
#import "DeviceUtil.h"
@implementation DeviceUtil
// e.g. [DeviceUtil osVersionSupported:@"4.1"]
+(BOOL)osVersionSupported:(NSString*)version {
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
BOOL osVersionSupported = ([currSysVer
compare:version
options:NSNumericSearch] != NSOrderedAscending);
return osVersionSupported;
}
@end
No comments:
Post a Comment