Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the proper iOS version programmatically?

I want to get the current os version of user device for some analysis in backend. Im trying to get it as below,

[[[UIDevice currentDevice] systemVersion] floatValue]; **//not returning the minor version number**

When I test this by running in my iPhone which is having iOS 8.0.2, this api returns me 8.000000 as the result but I need the exact iOS version which is 8.0.2

Any help in fixing this problem is appreciated in advance.

like image 358
Splendor_iOS Avatar asked Mar 30 '15 12:03

Splendor_iOS


People also ask

How do I find my OS version in Objective C?

An example code below dumps the iOS version and checks whether the version is greater than or equal to 6.0. // Get the system version of iOS at runtime. NSString *versionString = [[UIDevice currentDevice] systemVersion]; // Convert the version string to a Version instance.


1 Answers

In iOS 8 and above, you can use:

[[NSProcessInfo processInfo] operatingSystemVersion]

If you want to check the availablity of particular API, then there is a better way than checking OS versions, as explained here.

like image 68
ZeMoon Avatar answered Sep 22 '22 08:09

ZeMoon