//
//  DialogueViewController+initTextView.swift
//  MobilePortal
//
//  Created by caiyang on 2020/4/9.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

extension DialogueViewController {
    func inputText(){
        self.inputBoxView.block = {[weak self] in
            if (self?.inputBoxView.dialogueTextF.text != nil && self?.inputBoxView.dialogueTextF.text?.count != 0) {
                self?.addRight(title: (self?.inputBoxView.dialogueTextF.text)!)
                self?.actionHttpGCD()
            }
        }
        self.view.addGestureRecognizer(UITapGestureRecognizer.init(target: self, action: #selector(handleTap)))
    }
    @objc func handleTap(sender: UITapGestureRecognizer) {
        if sender.state == .ended {
//            print("收回键盘")
            self.inputBoxView.dialogueTextF.resignFirstResponder()
        }
        sender.cancelsTouchesInView = false
    }
    
}
