iOS version check
NSArray *versionCompatibility = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
if ( 5 == [[versionCompatibility objectAtIndex:0] intValue] ) { /// iOS5 is installed
// Put iOS-5 code here
} else { /// iOS4 is installed
// Put iOS-4 code here
}
Happy Coding :)
EDIT 1
So you can find the iOS version with this also
if (NSClassFromString(@"TWTweetComposeViewController") != nil) { /// iOS5 is installed
// Put iOS-5 code here
} else { /// iOS4 is installed
// Put iOS-4 code here
}
Or Can Check this out the most up-voted answer for this type of question