How to check if the version of iOS supports the library?

This question...

Check iOS version at runtime?

... got an answer explaining how to check if a class supports a method. (Over time, Apple may add methods that the class presented in the old iOS wouldn't have. Instead of testing the version of iOS, just check the class directly.)

Is it possible to do the same for the library? I want to continue building my products for iOS 3.1.3, but I would like to use CTTelephonyNetworkInfo when users have iOS 4.0, which is the earliest iOS that supports it.

Is it possible?

0
ios version
Oct 30 2018-10-10T00:
source share
1 answer

The solution here is to loosely connect with frameworks that are available only in newer versions of iOS, then use APIs such as NSClassFromString and respondsToSelector: to test if something exists before it is called. Check the features, not the firmware version.

+1
Oct 30 '10 at 0:45
source share



All Articles