Prevent deallocation of asyncDataSource and asyncDelegate in ASCollectionView and ASTableView

Grab a strong reference for asyncDataSource and asyncDelegate in ASCollectionView and ASTableView before executing the range update to be sure they are not going away while executing the range update. This can happen in range updates while going back in the view controller hierarchy
This commit is contained in:
Michael Schneider
2016-03-22 08:09:59 -07:00
parent fbe87cde4b
commit 3668f45286
4 changed files with 48 additions and 4 deletions

View File

@@ -49,6 +49,12 @@
*/
- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode;
/**
* Schedule a range update and call the completion block if finished. This drives updating the working
* ranges, and triggering their actions.
*/
- (void)scheduleRangeUpdateCompletion:(void (^)(void))completion;
@end
@@ -64,7 +70,10 @@
@interface ASViewController (ASRangeControllerUpdateRangeProtocol)
/// Automatically adjust range mode based on view events if the containing node confirms to the ASRangeControllerUpdateRangeProtocol
/**
* Automatically adjust range mode based on view events if the containing node confirms to the
* ASRangeControllerUpdateRangeProtocol
*/
@property (nonatomic, assign) BOOL automaticallyAdjustRangeModeBasedOnViewEvents;
@end