Can somebody tell me how to use @compatibility_alias to take a class, for example, UIActivityViewController, that is new to iOS 6, and use @compatibility_alias to make it work on iOS 5 and iOS 4. Please be specific and say where to put the code, and how to use it.
It is just an alias of method names, nothing more.
It is a feature of the Objective-C compiler rather than of the runtime
Looking at NSHipster we see:@compatibility_alias:
Allows existing classes to be aliased by a different name.
This allows one to write their own implementation of a class that is not available in the current SDK and "alias" the name to that of the class in the newer sdk. So, the key is to write or find another class that has the same methods and behaviors of another unavailable class.
There is no magic bullet here.
As an aside: I used to have to stand in line in the Post Office and there was a sign that said: "If it seems to good to be true, it probably is", that applies here.
See NSHipster, search for @compatibility_alias
.
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