mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Default proxy object for ASTableView and ASCollectionView
fixes #231 #233
This commit is contained in:
@@ -63,7 +63,6 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
return nil;
|
||||
}
|
||||
|
||||
ASDisplayNodeAssert(target, @"target must not be nil");
|
||||
ASDisplayNodeAssert(interceptor, @"interceptor must not be nil");
|
||||
|
||||
_target = target;
|
||||
@@ -135,6 +134,9 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
_dataController.dataSource = self;
|
||||
_dataController.delegate = _rangeController;
|
||||
|
||||
_proxyDelegate = [[_ASTableViewProxy alloc] initWithTarget:nil interceptor:self];
|
||||
super.delegate = (id<UITableViewDelegate>)_proxyDelegate;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -173,15 +175,9 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
if (_asyncDelegate == asyncDelegate)
|
||||
return;
|
||||
|
||||
if (asyncDelegate == nil) {
|
||||
_asyncDelegate = nil;
|
||||
_proxyDelegate = nil;
|
||||
super.delegate = nil;
|
||||
} else {
|
||||
_asyncDelegate = asyncDelegate;
|
||||
_proxyDelegate = [[_ASTableViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
|
||||
super.delegate = (id<UITableViewDelegate>)_proxyDelegate;
|
||||
}
|
||||
_asyncDelegate = asyncDelegate;
|
||||
_proxyDelegate = [[_ASTableViewProxy alloc] initWithTarget:asyncDelegate interceptor:self];
|
||||
super.delegate = (id<UITableViewDelegate>)_proxyDelegate;
|
||||
}
|
||||
|
||||
- (void)reloadData
|
||||
|
||||
Reference in New Issue
Block a user