0

This question...

Check iOS version at runtime?

...received an answer explaining how to test if a class supports a method. (Over time, Apple may have added methods that the class, as presented in an old iOS, would not have. Rather than test for the iOS version, just test the class directly.)

Can the same thing be done for a library? I want to keep building my products for iOS 3.1.3, but I'd like to make use of CTTelephonyNetworkInfo when the users have iOS 4.0, which is the earliest iOS that supports it.

Is this possible?

1 Answer 1

1

The solution here is to weak link against frameworks which are only available in newer versions of iOS then use APIs like NSClassFromString and respondsToSelector: for testing if something exists before calling it. Test for capability, not firmware version.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.