Skip to content

Instantly share code, notes, and snippets.

@programmingthomas
Created August 19, 2013 18:07
Show Gist options
  • Save programmingthomas/6272209 to your computer and use it in GitHub Desktop.
Save programmingthomas/6272209 to your computer and use it in GitHub Desktop.
Get iOS system version as float
+(float)systemVersion
{
NSArray * versionCompatibility = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
float total = 0;
int pot = 0;
for (NSNumber * number in versionCompatibility)
{
total += number.intValue * powf(10, pot);
pot--;
}
return total;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment