How to check if iOS 6 works on the device?

Possible duplicate:
How can we programmatically determine which version of iOS the device is running on?

How to check if iOS 6 works on the device? I need to check if os iOS 6 is for changing my YouTube video URLs due to Apple releases on how to handle them in iOS6

Like iOS 6, YouTube’s embedded URLs in the form http://www.youtube.com/watch?v=oHg5SJYRHA0 will no longer work. These URLs are for viewing videos on YouTube, and not for embedding on web pages. Instead, the format to be used is described at https://developers.google.com/youtube/player_parameters .

I was thinking of an if else statement to handle this.

thanks for any help

+6
source share
3 answers

As before matching the float parameters, you must put 6.0 in the float variable so that the LHS and RHS are the same for comparison:

float currentVersion = 6.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { NSLog(@"Running in IOS-6"); } 
+35
source
 NSString *versionString = [[UIDevice currentDevice] systemVersion]; // iOS version as string int versionStringInt = [ver intValue]; // iOS version as int float versionStringFloat = [ver floatValue]; // iOS version as float 
+1
source

Try below

  float deviceVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; NSLog(@"My Device version is :%f ",deviceVersion); 

Hope this helps you.

0
source

Source: https://habr.com/ru/post/927553/


All Articles