Merge pull request #26 from toulouse/requiresSuper

Annotate -didLoad with an attribute (if supported) that will flag missing didLoad calls
This commit is contained in:
appleguy
2014-10-14 21:22:44 -07:00
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.
*/
- (void)didLoad;
- (void)didLoad ASDISPLAYNODE_REQUIRES_SUPER;
/** @name Layout */

View File

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