From aaa0bc8c2284b95187a51b10e44df26758e96718 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 15 May 2020 15:34:00 +0300 Subject: Selection style --- Juick/ViewControllers/MessagesViewController.h | 1 + Juick/ViewControllers/MessagesViewController.m | 3 ++- Juick/ViewControllers/ThreadViewController.m | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'Juick/ViewControllers') diff --git a/Juick/ViewControllers/MessagesViewController.h b/Juick/ViewControllers/MessagesViewController.h index 7025e8b..d2fc935 100644 --- a/Juick/ViewControllers/MessagesViewController.h +++ b/Juick/ViewControllers/MessagesViewController.h @@ -19,6 +19,7 @@ extern NSString* const messageCellIdentifier; @property(nonatomic, strong) NSString *path; @property(nonatomic, strong) NSDictionary *params; @property(nonatomic, assign) BOOL shouldScrollToUnreadOnRefresh; +@property(nonatomic, assign) BOOL shouldAllowToSelectText; @property(nonatomic) NSNumber * firstUnread; -(void) refreshData; diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index f61d8b4..8fc6408 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -129,7 +129,7 @@ NSString* const messageCellIdentifier = @"messageCell"; } else { Message *msg = [self.messages objectAtIndex:indexPath.row]; MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:messageCellIdentifier forIndexPath:indexPath]; - [cell configureWithMessage:msg]; + [cell configureWithMessage:msg selectable:self.shouldAllowToSelectText]; return cell; } } @@ -141,6 +141,7 @@ NSString* const messageCellIdentifier = @"messageCell"; -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { Message *msg = [self.messages objectAtIndex:indexPath.row]; [self viewThreadForMessage:msg mid:msg.mid scrollTo:0]; + [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; } -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { diff --git a/Juick/ViewControllers/ThreadViewController.m b/Juick/ViewControllers/ThreadViewController.m index 8ee7623..fd754cf 100644 --- a/Juick/ViewControllers/ThreadViewController.m +++ b/Juick/ViewControllers/ThreadViewController.m @@ -49,4 +49,8 @@ [self refreshData]; } +- (BOOL)shouldAllowToSelectText { + return YES; +} + @end -- cgit v1.2.3