通过继承自 UITableView 来处理输入文本视图。是聊天应用的良好插件。使用 PHFComposeBarView 作为输入视图,它是一个非常好的可自定义的放大可变文本视图。
platform :ios, '8.0'
pod 'JBInputTableView'
您可以从 Storyboards、XIBs 或直接从代码中使用它。将您的 UITableView 更改为 JBInputTableView 并在 viewDidLoad 中设置它为第一个响应者。
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"CellIdentifier"];
self.tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
[self.tableView becomeFirstResponder];
}