Programmatically get iOS, iPadOS, macOS Catalyst Operating System Name and Version and a model identifier of iPhone, iPad, Mac devices.
Here is a simple way to programmatically get the operating system name and version of your iOS, iPadOS and macOS.
The below code will also return the value of iPhone, iPad and Mac Model identifier to help you know if it’s MacBook or iMac in Mac’s case or iPhone 11 Pro or iPhone 13 Pro etc.
Step 01: First import IOKit, It is only required for macOS Catalyst app-specific code.(more…)