 
 import UIKit
 
+enum JQComposeToolBarButtonType {
+    case Picture
+    case Mention
+    case Trend
+    case Emoticon
+    case Add
+}
+
 class JQComposeController: UIViewController {
 
     override func viewDidLoad() {
         super.viewDidLoad()
         view.backgroundColor = #colorLiteral(red: 0.2588235438, green: 0.7568627596, blue: 0.9686274529, alpha: 1)
         
-        self.setupUI()
-        
-//        self.navigationController?.navigationBar.isTranslucent = false
-    }
-
+        self.setTextUI()
+        self.setNavUI()
+        self.setToolBarUI()
+        registerNotification()
+    }
+
+    private func registerNotification() {
+        NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChange), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil)
+    }
+    
+    @objc private func keyboardWillChange(n: Notification) {
+    
+        let endFrame = (n.userInfo![UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
+        
+        //改变toolBar的位置
+        let offSetY = endFrame.origin.y - ScreenHeight
+        
+        toolBar.snp.updateConstraints { (update) in
+            update.bottom.equalTo(offSetY)
+        }
+        
+        UIView.animate(withDuration: 0.25) {
+            self.view.layoutIfNeeded()
+        }
+    }
+    
     @objc internal func back() {
         self.dismiss(animated: true, completion: nil)
     }
     
     @objc internal func sendBtnClick() {
+        
+    }
+    
+    @objc internal func typeButtonClick(button: UIButton) {
+        
+        print(button.tag)
+        switch button.tag {
+        case 0:
+            print("发布图片")
+        case 1:
+            print("发布表情")
+        default:
+            print("瞎点")
+        }
         
     }
     

        
        let label = UILabel(title: "分享新鲜事...", textColor: UIColor.lightGray, fontSize: 14)
        return label
    }()

}

        self.navigationItem.titleView = label
    }
    
    
    internal func setToolBarUI() {
        
        view.addSubview(toolBar)
        
        toolBar.snp.makeConstraints { (make) in
            make.left.right.bottom.equalTo(self.view)
        }
        
    }

}
