mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
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<MyASDisplayNodeSubclass *> @end
This commit is contained in:
@@ -11,11 +11,11 @@
|
|||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
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.
|
* @abstract Passthrough property to the the .interfaceState of the node.
|
||||||
|
|||||||
Reference in New Issue
Block a user