Checking iOS Version

iOS 8 and later

Swift 3:

let minimumVersion = OperatingSystemVersion(majorVersion: 8, minorVersion: 1, patchVersion: 2)
if ProcessInfo().isOperatingSystemAtLeast(minimumVersion) {//current version is >= (8.1.2)} else {
//current version is < (8.1.2)}

Swift 2.0 and later

if #available(iOS 9, *) {
// iOS 9} else {
// iOS 8 or earlier}

Compare versions

let minimumVersionString = "3.1.3"
let versionComparison =…

--

--

iOS Developer, Triple graduated, Passionate, Love workout, blogger

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mr.Javed Multani

iOS Developer, Triple graduated, Passionate, Love workout, blogger