zoukankan      html  css  js  c++  java
  • iOS 系统版本的判断

     iOS 宏定义系统版本的判断

    #define iOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
    #define iOS7Later ([UIDevice currentDevice].systemVersion.floatValue >= 7.0f)
    #define iOS8Later ([UIDevice currentDevice].systemVersion.floatValue >= 8.0f)
    #define iOS9Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.0f)
    #define iOS9_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 9.1f)
    #define iOS10_1Later ([UIDevice currentDevice].systemVersion.floatValue >= 10.1f)
     
    很多人都是用的这种方法,在此之前我也用的这种宏定义的方法,但是在xcode的开发环境中已经定义好了很多 系统版本判别的宏定义 包含iOS 、 Mac、TVOS、WATCHOS的系统版本的宏,截图如下:
      
     
    只要在使用时 用下面的方法就可以了
     
    #ifdef __IPHONE_7_0
      //iOS7的新特性代码
    #endif
     
    或者是使用:
     
    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
     
      //iOS7的新特性代码
    #endif(__IPHONE_OS_VERSION_MAX_ALLOWED 这个定义是在Simulator-IOS7.0/usr/include/AvailabilityInternal.h文件中)
     
    就搞定了。
  • 相关阅读:
    [Agc081F/At2699] Flip and Rectangles
    [CF1216C] White Sheet
    stegsolve使用探究
    栅栏密码
    wireshark常用命令
    某团队线下赛AWD writeup&Beescms_V4.0代码审计
    某线下赛AWD
    BBScan — 一个信息泄漏批量扫描脚本
    ISG2018 web题Writeup
    巅峰极客第二场CTF部分writeup
  • 原文地址:https://www.cnblogs.com/Rong-Shengcom/p/6272460.html
Copyright © 2011-2022 走看看