I was able to reproduce the bug by using bad network conditioner.
This commit is contained in:
manuroe
2017-06-09 12:09:20 +02:00
parent bb8c79d65f
commit 728082c663
+13 -1
View File
@@ -220,14 +220,20 @@
[self addSpinnerFooterView];
__weak __typeof(self) weakSelf = self;
[dataSource paginate:^(NSUInteger roomsAdded) {
if (weakSelf)
{
__strong __typeof(weakSelf) self = weakSelf;
if (roomsAdded)
{
// Notify the table view there are new items at its tail
NSMutableArray<NSIndexPath *> *indexPaths = [NSMutableArray arrayWithCapacity:roomsAdded];
NSUInteger numberOfRowsBefore = [dataSource tableView:self.tableView numberOfRowsInSection:0];
NSUInteger numberOfRowsBefore = [self->dataSource tableView:self.tableView numberOfRowsInSection:0];
numberOfRowsBefore -= roomsAdded;
for (NSUInteger i = 0; i < roomsAdded; i++)
@@ -240,10 +246,16 @@
}
[self removeSpinnerFooterView];
}
} failure:^(NSError *error) {
if (weakSelf)
{
__strong __typeof(weakSelf) self = weakSelf;
[self removeSpinnerFooterView];
}
}];
}