I have a piece of code that only works on iOS 6 or greater.
control.tintColor = [UIColor greenColor];
Is there a ready to use compiler directive like #ifdef iOS6_or_greater
?
It's best if you check against the functionality, instead of the iOS version.
For example you can use respondsToSelector to see if a given method is supported.
[someObject respondsToSelector:@selector(someMethod)]
Failing that, there is a preprocessor directive
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
- (BOOL)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
#endif
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