Swiftgram/AsyncDisplayKit/ASNodeController.mm
Hannah Troisi 7f7f28385d [ASNodeController] First implementation of node controller class (#2945)
* [ASNodeController] initial commit for node controller class

* create <ASInterfaceState> protocol, -[ASDisplayNode interfaceDelegate], and use these to forward to ASNodeController

* rename ASInterfaceStateDelegate, fix setting in it ASNodeController.mm
2017-01-31 14:27:02 -08:00

58 lines
986 B
Plaintext

//
// ASNodeController.mm
// AsyncDisplayKit
//
// Created by Hannah Troisi for Scott Goodson on 1/27/17.
// Copyright © 2017 Facebook. All rights reserved.
//
#import "ASNodeController.h"
#import "ASDisplayNode+FrameworkPrivate.h"
@implementation ASNodeController
@synthesize node = _node;
- (instancetype)init
{
self = [super init];
if (self) {
}
return self;
}
- (void)loadNode
{
self.node = [[ASDisplayNode alloc] init];
}
- (ASDisplayNode *)node
{
if (_node == nil) {
[self loadNode];
}
return _node;
}
-(void)setNode:(ASDisplayNode *)node
{
_node = node;
_node.interfaceStateDelegate = self;
}
// subclass overrides
- (void)didEnterVisibleState {}
- (void)didExitVisibleState {}
- (void)didEnterDisplayState {}
- (void)didExitDisplayState {}
- (void)didEnterPreloadState {}
- (void)didExitPreloadState {}
- (void)interfaceStateDidChange:(ASInterfaceState)newState
fromState:(ASInterfaceState)oldState {}
@end