First, the easiest way to do it will be have the most recent version of component that support the lowest deployment target.
But if you really want to have different version for each iOS
, I don't know better solution, than just rename all classes from, for example, older version (because there was only two classes) and manage creation of this controller programmatically, because there's no way to set different class for different iOS
version in xib
's or storyboard
's. You need to wrap each and every call of this component with iOS
version check ( How to check iOS version? ).
Imports and variables you can leave for each version of component without check.
The trick you mentioned failed in this case, because it works good for different architecture, because binaries for different architectures will be included in final app and that's named fat binary
, but there's the same architecture for iOS6
and iOS7
( only one new in iOS7
- arm64
). So you can't wrap only include
s with preprocessor macros and get fat binary
with different code for each iOS version.
I hope you've understood something from my explanation.