diff --git a/AsyncDisplayKit/ASDisplayNode+Subclasses.h b/AsyncDisplayKit/ASDisplayNode+Subclasses.h index 290d1ff7c6..eb4720ceee 100644 --- a/AsyncDisplayKit/ASDisplayNode+Subclasses.h +++ b/AsyncDisplayKit/ASDisplayNode+Subclasses.h @@ -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 */ diff --git a/Base/ASBaseDefines.h b/Base/ASBaseDefines.h index 1beeca05fe..dcf9dbe825 100755 --- a/Base/ASBaseDefines.h +++ b/Base/ASBaseDefines.h @@ -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