diff options
author | Vitaly Takmazov | 2017-12-05 01:40:51 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-12-05 01:40:51 +0300 |
commit | a228ce07cc5413a6ba164c12042ab1e4028aa5b3 (patch) | |
tree | f1e8eafe6ebcf9beebd9a0ebdd4a1f8d591f8698 /Juick/ViewControllers/ThreadViewController.m | |
parent | 888cbddb1eaab4f4f343ffd6e0bf8d976b579794 (diff) |
comment
Diffstat (limited to 'Juick/ViewControllers/ThreadViewController.m')
-rw-r--r-- | Juick/ViewControllers/ThreadViewController.m | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Juick/ViewControllers/ThreadViewController.m b/Juick/ViewControllers/ThreadViewController.m index 2b0d3c4..95c9839 100644 --- a/Juick/ViewControllers/ThreadViewController.m +++ b/Juick/ViewControllers/ThreadViewController.m @@ -53,15 +53,17 @@ -(void) updateQuoteText:(Message *)message { MessageInputView *inputView = (MessageInputView *)self.inputAccessoryView; inputView.quoteText.text = message.text; - [inputView.contentView setNeedsUpdateConstraints]; - [inputView.contentView updateConstraintsIfNeeded]; - [inputView.contentView setNeedsLayout]; - [inputView.contentView layoutIfNeeded]; + [inputView.textContent becomeFirstResponder]; } -(void) sendReply { MessageInputView *inputView = (MessageInputView *)self.inputAccessoryView; Message *msg = [self.messages firstObject]; - [[APIClient sharedClient] postReplyToThread:msg.mid inReplyTo:self.replyTo text:inputView.textContent.text]; + [[APIClient sharedClient] postReplyToThread:msg.mid inReplyTo:self.replyTo text:inputView.textContent.text result:^(Message *msg, NSError *err) { + MessageInputView *inputView = (MessageInputView *)self.inputAccessoryView; + inputView.quoteText.text = @""; + [inputView.textContent endEditing:YES]; + [self refreshData]; + }]; } -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { |