mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-03-25 09:25:47 +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 {
|
||||
[super viewWillAppear:animated];
|
||||
[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];
|
||||
postP.then(^{
|
||||
if (self.selectedIndexPath && [self postForIndexPath:self.selectedIndexPath]) {
|
||||
[self.tableView selectRowAtIndexPath:self.selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionMiddle];
|
||||
self.selectedIndexPath = nil;
|
||||
}
|
||||
if (self.clearsSelectionOnViewWillAppear && self.tableView.indexPathForSelectedRow) {
|
||||
[self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:YES];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue