From ccf06c2af74f63e5276e15f3e10acf74bf4174f7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 3 Dec 2017 20:12:08 +0300 Subject: WIP --- Juick/ViewControllers/ThreadViewController.m | 36 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'Juick/ViewControllers/ThreadViewController.m') diff --git a/Juick/ViewControllers/ThreadViewController.m b/Juick/ViewControllers/ThreadViewController.m index 893765b..4de0cab 100644 --- a/Juick/ViewControllers/ThreadViewController.m +++ b/Juick/ViewControllers/ThreadViewController.m @@ -9,23 +9,20 @@ #import "ThreadViewController.h" #import "ColorScheme.h" #import "MessageCell.h" +@import PHFComposeBarView; @interface ThreadViewController () @property (nonatomic, readwrite, retain) UIView *inputAccessoryView; +-(void) updateQuoteText:(Message *)message; + @end @implementation ThreadViewController - (void)viewDidLoad { [super viewDidLoad]; - - // Uncomment the following line to preserve selection between presentations. - // self.clearsSelectionOnViewWillAppear = NO; - - // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - // self.navigationItem.rightBarButtonItem = self.editButtonItem; } @@ -36,17 +33,26 @@ - (UIView *)inputAccessoryView { if (!_inputAccessoryView) { CGRect viewBounds = self.view.bounds; - CGRect frame = CGRectMake(0, viewBounds.size.height - PHFComposeBarViewInitialHeight, viewBounds.size.width, - PHFComposeBarViewInitialHeight); - PHFComposeBarView *_view = [[PHFComposeBarView alloc] initWithFrame:frame]; - _view.backgroundColor = [UIColor whiteColor]; - _view.buttonTintColor = [ColorScheme linkColor]; - _view.maxLinesCount = 4; - _view.utilityButtonImage = [UIImage imageNamed:@"Camera"]; - _view.delegate = self; - _inputAccessoryView = _view; + CGRect frame = CGRectMake(0, viewBounds.size.height - PHFComposeBarViewInitialHeight - self.view.safeAreaInsets.top + self.view.safeAreaInsets.bottom, viewBounds.size.width, PHFComposeBarViewInitialHeight); + PHFComposeBarView *inputView = [[PHFComposeBarView alloc] initWithFrame:frame]; + inputView.backgroundColor = [UIColor whiteColor]; + inputView.buttonTintColor = [ColorScheme linkColor]; + inputView.maxLinesCount = 4; + inputView.utilityButtonImage = [UIImage imageNamed:@"Camera"]; + inputView.delegate = self; + _inputAccessoryView = inputView; } return _inputAccessoryView; } +-(void) updateQuoteText:(Message *)message { + /*MessageInputView *inputView = (MessageInputView *)self.inputAccessoryView; + inputView.quoteText.text = message.text;*/ +} + +-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + Message * selectedMessage = [self.messages objectAtIndex:indexPath.row]; + [self updateQuoteText:selectedMessage]; +} + @end -- cgit v1.2.3