mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 17:43:18 +00:00
Merge pull request #141 from facebook/proxy-teardown
_ASTableViewProxy & _ASCollectionViewProxy fixes.
This commit is contained in:
commit
6cdff0e66d
@ -139,20 +139,32 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
{
|
{
|
||||||
if (_asyncDataSource == asyncDataSource)
|
if (_asyncDataSource == asyncDataSource)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_asyncDataSource = asyncDataSource;
|
if (asyncDataSource == nil) {
|
||||||
_proxyDataSource = [[_ASCollectionViewProxy alloc] initWithTarget:_asyncDataSource interceptor:self];
|
_asyncDataSource = nil;
|
||||||
super.dataSource = (id<UICollectionViewDataSource>)_proxyDataSource;
|
_proxyDataSource = nil;
|
||||||
|
super.dataSource = nil;
|
||||||
|
} else {
|
||||||
|
_asyncDataSource = asyncDataSource;
|
||||||
|
_proxyDataSource = [[_ASCollectionViewProxy alloc] initWithTarget:_asyncDataSource interceptor:self];
|
||||||
|
super.dataSource = (id<UICollectionViewDataSource>)_proxyDataSource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setAsyncDelegate:(id<ASCollectionViewDelegate>)asyncDelegate
|
- (void)setAsyncDelegate:(id<ASCollectionViewDelegate>)asyncDelegate
|
||||||
{
|
{
|
||||||
if (_asyncDelegate == asyncDelegate)
|
if (_asyncDelegate == asyncDelegate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_asyncDelegate = asyncDelegate;
|
if (asyncDelegate == nil) {
|
||||||
_proxyDelegate = [[_ASCollectionViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
|
_asyncDelegate = nil;
|
||||||
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
_proxyDelegate = nil;
|
||||||
|
super.delegate = nil;
|
||||||
|
} else {
|
||||||
|
_asyncDelegate = asyncDelegate;
|
||||||
|
_proxyDelegate = [[_ASCollectionViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
|
||||||
|
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (ASRangeTuningParameters)rangeTuningParameters
|
- (ASRangeTuningParameters)rangeTuningParameters
|
||||||
|
|||||||
@ -149,9 +149,15 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
if (_asyncDataSource == asyncDataSource)
|
if (_asyncDataSource == asyncDataSource)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_asyncDataSource = asyncDataSource;
|
if (asyncDataSource == nil) {
|
||||||
_proxyDataSource = [[_ASTableViewProxy alloc] initWithTarget:_asyncDataSource interceptor:self];
|
_asyncDataSource = nil;
|
||||||
super.dataSource = (id<UITableViewDataSource>)_proxyDataSource;
|
_proxyDataSource = nil;
|
||||||
|
super.dataSource = nil;
|
||||||
|
} else {
|
||||||
|
_asyncDataSource = asyncDataSource;
|
||||||
|
_proxyDataSource = [[_ASTableViewProxy alloc] initWithTarget:_asyncDataSource interceptor:self];
|
||||||
|
super.dataSource = (id<UITableViewDataSource>)_proxyDataSource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setAsyncDelegate:(id<ASTableViewDelegate>)asyncDelegate
|
- (void)setAsyncDelegate:(id<ASTableViewDelegate>)asyncDelegate
|
||||||
@ -159,9 +165,15 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
if (_asyncDelegate == asyncDelegate)
|
if (_asyncDelegate == asyncDelegate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_asyncDelegate = asyncDelegate;
|
if (asyncDelegate == nil) {
|
||||||
_proxyDelegate = [[_ASTableViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
|
_asyncDelegate = nil;
|
||||||
super.delegate = (id<UITableViewDelegate>)_proxyDelegate;
|
_proxyDelegate = nil;
|
||||||
|
super.delegate = nil;
|
||||||
|
} else {
|
||||||
|
_asyncDelegate = asyncDelegate;
|
||||||
|
_proxyDelegate = [[_ASTableViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
|
||||||
|
super.delegate = (id<UITableViewDelegate>)_proxyDelegate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (ASRangeTuningParameters)rangeTuningParameters
|
- (ASRangeTuningParameters)rangeTuningParameters
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user