Deprecating methods in Objective-C
Nothing lasts forever
November 9
2018
Sometimes you think of a better way of doing things or you got something wrong and you need to deprecate the older version. It would be great if the compiler could help. Well it can!
The ever useful NSObjCRuntime.h
defines:
All of which are macros that expand out to __attributes__
which will help the compiler inform you and anyone else of their use. For example:
Where the method someDeprecatedMethod:
was introduced in macOS 10.4 Tiger and iOS 2, and deprecated in macOS 10.14 Mojave and iOS 12.
License
Any source in this article is released under the ISC License.