如何找出iOS版本

rih*_*iha 11 version xamarin.ios ios

是否可以阅读运行MonoTouch应用程序的iOS版本(4.2.1,4.3.3等)?如果是这样,怎么样?

Ant*_*ton 27

试试UIDevice.CurrentDevice.SystemVersion.


Dan*_*mov 11

如果你只需要一个布尔条件,有一个方便的方法:

if (UIDevice.CurrentDevice.CheckSystemVersion (6, 0)) // at least 6.0
Run Code Online (Sandbox Code Playgroud)


cal*_*sto 6

在MonoTouch中:

要获得主要版本使用:

UIDevice.CurrentDevice.SystemVersion.Split('.')[0]
Run Code Online (Sandbox Code Playgroud)

对于次要版本使用:

UIDevice.CurrentDevice.SystemVersion.Split('.')[1]
Run Code Online (Sandbox Code Playgroud)