mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-04-27 15:07:44 +00:00
improve post selection handling
This commit is contained in:
parent
4d20adec84
commit
1f54984542
1 changed files with 3 additions and 3 deletions
|
|
@ -195,15 +195,15 @@ static const NSUInteger SectionPublished = 1;
|
||||||
- (void)viewWillAppear:(BOOL)animated {
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
[super viewWillAppear:animated];
|
[super viewWillAppear:animated];
|
||||||
[self requestStatusWithCaching:YES];
|
[self requestStatusWithCaching:YES];
|
||||||
if (self.clearsSelectionOnViewWillAppear && self.tableView.indexPathForSelectedRow) {
|
|
||||||
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
|
|
||||||
}
|
|
||||||
PMKPromise *postP = self.postCollections ? [PMKPromise promiseWithValue:self.postCollections] : [self requestPostsWithCaching:YES];
|
PMKPromise *postP = self.postCollections ? [PMKPromise promiseWithValue:self.postCollections] : [self requestPostsWithCaching:YES];
|
||||||
postP.then(^{
|
postP.then(^{
|
||||||
if (self.selectedIndexPath && [self postForIndexPath:self.selectedIndexPath]) {
|
if (self.selectedIndexPath && [self postForIndexPath:self.selectedIndexPath]) {
|
||||||
[self.tableView selectRowAtIndexPath:self.selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionMiddle];
|
[self.tableView selectRowAtIndexPath:self.selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionMiddle];
|
||||||
self.selectedIndexPath = nil;
|
self.selectedIndexPath = nil;
|
||||||
}
|
}
|
||||||
|
if (self.clearsSelectionOnViewWillAppear && self.tableView.indexPathForSelectedRow) {
|
||||||
|
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue