mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-10 16:29:55 +00:00
Fix logic cleaning data if delegate / dataSource changes and bring over logic to ASTableView (#1200)
* Cleanup in ASTableView datasource/delegate change * Fix experiments logic * Add changelog entry
This commit is contained in:
parent
055d27c45a
commit
fec14f8310
@ -69,6 +69,7 @@
|
||||
- Yoga integration improvements [Michael Schneider](https://github.com/maicki)[#1187] (https://github.com/TextureGroup/Texture/pull/1187)
|
||||
- Correct linePositionModifier behavior [Michael Schneider](https://github.com/maicki)[#1192] (https://github.com/TextureGroup/Texture/pull/1192)
|
||||
- Tweak a11y label aggregation behavior to enable container label overrides [Michael Schneider](https://github.com/maicki)[#1199] (https://github.com/TextureGroup/Texture/pull/1199)
|
||||
- Fix logic cleaning data if delegate / dataSource changes and bring over logic to ASTableView [Michael Schneider](https://github.com/maicki)[#1200] (https://github.com/TextureGroup/Texture/pull/1200)
|
||||
|
||||
## 2.7
|
||||
- Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877)
|
||||
|
||||
@ -576,10 +576,16 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
|
||||
- (void)_asyncDelegateOrDataSourceDidChange
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
if (_asyncDataSource == nil && _asyncDelegate == nil && _isDeallocating && ASActivateExperimentalFeature(ASExperimentalClearDataDuringDeallocation)) {
|
||||
[_dataController clearData];
|
||||
}
|
||||
|
||||
if (_asyncDataSource == nil && _asyncDelegate == nil) {
|
||||
if (ASActivateExperimentalFeature(ASExperimentalClearDataDuringDeallocation)) {
|
||||
if (_isDeallocating) {
|
||||
[_dataController clearData];
|
||||
}
|
||||
} else {
|
||||
[_dataController clearData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setCollectionViewLayout:(nonnull UICollectionViewLayout *)collectionViewLayout
|
||||
|
||||
@ -436,6 +436,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
|
||||
_dataController.validationErrorSource = asyncDataSource;
|
||||
super.dataSource = (id<UITableViewDataSource>)_proxyDataSource;
|
||||
[self _asyncDelegateOrDataSourceDidChange];
|
||||
}
|
||||
|
||||
- (id<ASTableDelegate>)asyncDelegate
|
||||
@ -506,6 +507,22 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
}
|
||||
|
||||
super.delegate = (id<UITableViewDelegate>)_proxyDelegate;
|
||||
[self _asyncDelegateOrDataSourceDidChange];
|
||||
}
|
||||
|
||||
- (void)_asyncDelegateOrDataSourceDidChange
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
if (_asyncDataSource == nil && _asyncDelegate == nil) {
|
||||
if (ASActivateExperimentalFeature(ASExperimentalClearDataDuringDeallocation)) {
|
||||
if (_isDeallocating) {
|
||||
[_dataController clearData];
|
||||
}
|
||||
} else {
|
||||
[_dataController clearData];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)proxyTargetHasDeallocated:(ASDelegateProxy *)proxy
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user