From f533235530e20431ad5188b46e4c377cc8a0e96b Mon Sep 17 00:00:00 2001 From: iddoeldor Date: Thu, 5 Nov 2020 17:43:26 +0200 Subject: [PATCH] improv get iOS version --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 749aaf7..5ac68d5 100644 --- a/README.md +++ b/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); +} ```