This question already has an answer here:
- How to check iOS version? 37 answers
I need to reconfigure some UI based on the iOS version I am running against, so I need a good way of checking the iOS version. For the time being I am doing this:
if ([[[UIDevice currentDevice] systemVersion] isEqualToString: @"7.0"]) {
//do stuff
}
I'd prefer not to hard code these string comparisons and make decisions based on that. Are there any better ways of doing this?
I always keep those in my Constants.h file:
Although I'll always prefer the above macros, for the completion of the accepted answer, here is the apple approved way: