From a509b7523f4ba42bcd3b0735ba1051431a2d15a7 Mon Sep 17 00:00:00 2001 From: Rahul Malik Date: Sun, 3 Jan 2016 17:45:51 -0800 Subject: [PATCH] Update interface of ASViewController to use lightweight generics. This allows subclasses of ASViewController to specify the type of ASDisplayNode it contains which allows for stronger type-checking and auto-completion against the specified type. Example Subclass Declaration: @interface MyASViewController : ASViewController @end --- AsyncDisplayKit/ASViewController.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AsyncDisplayKit/ASViewController.h b/AsyncDisplayKit/ASViewController.h index 74c674f6e0..d7286272b8 100644 --- a/AsyncDisplayKit/ASViewController.h +++ b/AsyncDisplayKit/ASViewController.h @@ -11,11 +11,11 @@ NS_ASSUME_NONNULL_BEGIN -@interface ASViewController : UIViewController +@interface ASViewController<__covariant DisplayNodeType : ASDisplayNode *> : UIViewController -- (instancetype)initWithNode:(ASDisplayNode *)node NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithNode:(DisplayNodeType)node NS_DESIGNATED_INITIALIZER; -@property (nonatomic, strong, readonly) ASDisplayNode *node; +@property (nonatomic, strong, readonly) DisplayNodeType node; /** * @abstract Passthrough property to the the .interfaceState of the node.