Nikhil Patel
Nikhil Patel

Reputation: 1781

Different ways to check iOS version?

I've seen various methods of checking the iOS version of the device.

From some example in Apple Documentation :

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
    // < = 6.1
} else {
    // > = 7
}

And from many examples over SO / Internet :

[[UIDevice currentDevice] systemVersion]

What is the difference between NSFoundationVersionNumber and [[UIDevice currentDevice] systemVersion] ?

And which one should we use ?

Upvotes: 2

Views: 1315

Answers (1)

Albara
Albara

Reputation: 1296

They basically provide the same answer, however, NSFoundationVersionNumber is better, as no string parsing of the systemVersion is needed.

Upvotes: 3

Related Questions