improv get iOS version
This commit is contained in:
parent
6fe08f607c
commit
f533235530
11
README.md
11
README.md
@ -2242,7 +2242,18 @@ UIDevice.$ownMethods
|
||||
console.log(method, ':', UIDevice[method]())
|
||||
})
|
||||
console.log('executablePath =', ObjC.classes.NSBundle.mainBundle().executablePath().toString());
|
||||
```
|
||||
|
||||
```js
|
||||
if (ObjC.available) {
|
||||
var processInfo = ObjC.classes.NSProcessInfo.processInfo();
|
||||
var versionString = processInfo.operatingSystemVersionString().toString();
|
||||
// E.g. "Version 13.5 (Build 17F75)"
|
||||
var ver = versionString.split(' ');
|
||||
var version = ver[1];
|
||||
// E.g. 13.5
|
||||
console.log("iOS version: " + version);
|
||||
}
|
||||
```
|
||||
|
||||
<details>
|
||||
|
Loading…
Reference in New Issue
Block a user