Possible Duplicate:
How can we programmatically detect which iOS version is device running on?
How do I check if a device is running iOS 6? I need to check to see if the os is iOS 6 in order to change my youtube video urls because of the release notes from Apple on how to handle them in iOS6
As of iOS 6, embedded YouTube URLs in the form of http://www.youtube.com/watch?v=oHg5SJYRHA0 will no longer work. These URLs are for viewing the video on the YouTube site, not for embedding in web pages. Instead, the format that should be used is described in https://developers.google.com/youtube/player_parameters.
I was thinking of an if else statement to handle this.
thanks for any help
As Before comparing float parameters you should put 6.0 in a float variable so that LHS and RHS should be the same to compare:
float currentVersion = 6.0;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion)
{
NSLog(@"Running in IOS-6");
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With