I'm trying to check for the availability of the UIAppearance class using:
NSClassFromString(@"UIAppearance")
However this returns nil from both iOS4 and iOS5 - anyone got any tips on how to work around this?
UIAppearance is not a class, it is a protocol. So in order to check wether it exists or not, you would use:
NSProtocolFromString(@"UIAppearance");
It returns null on < iOS5, but an object on iOS5.
This might come in handy:
List of Classes that Support UIAppearance in iOS 5
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