// // ThreadViewController.m // Juick // // Created by Vitaly Takmazov on 24/09/2017. // Copyright © 2017 com.juick. All rights reserved. // #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]; } - (BOOL) canBecomeFirstResponder { return YES; } - (UIView *)inputAccessoryView { if (!_inputAccessoryView) { CGRect viewBounds = self.view.bounds; 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