Check iOS Version


You can get the OS version using: 
NString *systemVersion = [[UIDevice currentDevicesystemVersion];

#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)

#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)

#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

Usage : 

    if (SYSTEM_VERSION_LESS_THAN(@"5.0")) {

        

    }
    else {
        
    }


source: stackoverflow.com

1 comment:

  1. Anonymous5/27/2013

    Piece of writing writing is also a excitement, if you know after that you can write otherwise it is complicated to write.


    Green coffee extract weight loss

    ReplyDelete