Last Updated: February 25, 2016
·
707
· kamiro

Mark as deprecated/unavailable

Apple includes availability macros to allow you to transition your code safely while working in a team environment. Also shows compiler messages when using deprecated/unavailable messages

Simply import the following in to your header file:

#import <AvailabilityMacros.h>

Then mark functions by attaching the appropriate keyword to the end of the message definition in your header file:

- (void)noLongerAvailable UNAVAILABLE_ATTRIBUTE;
- (void)availableButFindAnotherWay DEPRECATED_ATTRIBUTE;

This is much more pleasant then the equivalent:

__attribute__((deprecated))