美文网首页
ios系统version检测

ios系统version检测

作者: 就叫我Kuzan | 来源:发表于2017-06-28 15:49 被阅读4次

    Stackoverflow看到了关于检查iOS系统版本号的一段很好的宏定义,在其他地方也看过这段宏,这次几个笔记,stackoverflow问题
    #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)

    相关文章

      网友评论

          本文标题:ios系统version检测

          本文链接:https://www.haomeiwen.com/subject/fsmucxtx.html