I introduced Printing via AirPrint recently, but wanted to not drop support for pre 4.2 versions (obviously). Done it before for things like Game Center, etc. What I found particularly odd in this case was I had to weak link UIKit. Printing was not contained in its own framework allowing me to be more granular.
This just didn't feel right, although it solves my problem allowing the app to run properly on all versions.
In Apple's SDK Compatibility Guide they state:
When using a framework that is available in your deployment target, you should require that framework (and not weakly link it).
UIKit is available, just not classes such as UIPrintInfo
, UIPrintInteractionController
, etc.
Am I right that it seems odd to weakly link such a core framework? Is there a better way?
There is a better way. iOS 4.2 introduced NS_CLASS_AVAILABLE for this purpose, but there are some restrictions on using it. All the details are listed in the documentation linked to below:
http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/cross_development/Using/using.html
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