How to check iOS version?

后端 未结 30 2513
一生所求
一生所求 2020-11-21 06:37

I want to check if the iOS version of the device is greater than 3.1.3 I tried things like:

[[UIDevice currentDevice].systemVersion         


        
30条回答
  •  猫巷女王i
    2020-11-21 07:17

    float deviceOSVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
    float versionToBeCompared = 3.1.3; //(For Example in your case)
    
    if(deviceOSVersion < versionToBeCompared)
       //Do whatever you need to do. Device version is lesser than 3.1.3(in your case)
    else 
       //Device version should be either equal to the version you specified or above
    

提交回复
热议问题