Annotate -didLoad with an attribute (if supported) that will flag missing didLoad calls

This commit is contained in:
Andrew Toulouse
2014-09-22 21:55:35 -07:00
parent 7dd94a6102
commit 1b3cf4d8b5
2 changed files with 13 additions and 1 deletions

View File

@@ -74,7 +74,7 @@
* *
* @discussion This is the best time to add gesture recognizers to the view. * @discussion This is the best time to add gesture recognizers to the view.
*/ */
- (void)didLoad; - (void)didLoad ASDISPLAYNODE_REQUIRES_SUPER;
/** @name Layout */ /** @name Layout */

View File

@@ -90,6 +90,10 @@
#define __has_feature(x) 0 // Compatibility with non-clang compilers. #define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif #endif
#ifndef __has_attribute // Optional.
#define __has_attribute(x) 0 // Compatibility with non-clang compilers.
#endif
#ifndef NS_CONSUMED #ifndef NS_CONSUMED
#if __has_feature(attribute_ns_consumed) #if __has_feature(attribute_ns_consumed)
#define NS_CONSUMED __attribute__((ns_consumed)) #define NS_CONSUMED __attribute__((ns_consumed))
@@ -129,3 +133,11 @@
// http://gcc.gnu.org/onlinedocs/cpp/Stringification.html // http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
#define ASDISPLAYNODE_TO_STRING(str) #str #define ASDISPLAYNODE_TO_STRING(str) #str
#define ASDISPLAYNODE_TO_UNICODE_STRING(str) @ASDISPLAYNODE_TO_STRING(str) #define ASDISPLAYNODE_TO_UNICODE_STRING(str) @ASDISPLAYNODE_TO_STRING(str)
#ifndef ASDISPLAYNODE_REQUIRES_SUPER
#if __has_attribute(objc_requires_super)
#define ASDISPLAYNODE_REQUIRES_SUPER __attribute__((objc_requires_super))
#else
#define ASDISPLAYNODE_REQUIRES_SUPER
#endif
#endif