Skip to content

Instantly share code, notes, and snippets.

@ekdevdes
Created March 13, 2012 16:13
Show Gist options
  • Save ekdevdes/2029657 to your computer and use it in GitHub Desktop.
Save ekdevdes/2029657 to your computer and use it in GitHub Desktop.
Find out if the device has iOS4 or iOS5 installed, and perform a version-specific action based on the results.
NSArray *versions = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
if ( 5 == [[versions objectAtIndex:0] intValue] ) { /// iOS5 is installed
// Perform iOS-5 actions here
} else { /// iOS4 is installed
// Perform iOS-4 actions here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment