For example there is a new class in iOS 7 that does not exist in iOS 6. I want to use this new class. My app must stay compatible with iOS 6. So I read in some places that you can now do this:
if ([NSURLSessionConfiguration class]) {
// only in iOS 7
} else {
// do it iOS6 way
}
Is this safe to do in any iOS 6 version or should we still use NSClassFromString
?
This is the correct and recommended way of checking to see if certain classes are available to be used.
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