Search code examples
iphoneiosios4

Identify device's iOS version dynamically


Possible Duplicate:
How to check iOS version?

I'm building an app that has an SMS composer (which isn't available in 3.0). How can I find the underlying device's OS version dynamically and make the SMS option available, and if not disable the function?


Solution

  • I think you could use NSClassFromString(@"MFMessageComposeViewController") to see if the class is available.

    (Caveat: You couldn't check for UIGestureRecognizer this way because Apple used private class with the same name. Same could be true for MFMessageComposeViewController.)