         }
     }
 
+    func toggleRecordVoice() {
+        if state == .VoiceRecord {
+            state = .Default
+
+        } else {
+            state = .VoiceRecord
+        }
+    }
+
     func trySendImageMessage() {
         if let imageSendAction = imageSendAction {
             imageSendAction(messageToolBar: self)

                micButton.hidden = false
                sendButton.hidden = true

            case .TextInput:
                micButton.hidden = true
                sendButton.hidden = false
            }

            updateHeightOfMessageTextView()

        let button = UIButton()
        button.setImage(UIImage(named: "item_mic"), forState: .Normal)
        button.tintColor = UIColor.yepTintColor()
        button.addTarget(self, action: "toggleRecordVoice", forControlEvents: UIControlEvents.TouchUpInside)
        return button
        }()

    lazy var voiceRecordButton: UIButton = {
        let button = UIButton()
        button.setImage(UIImage(named: "item_mic"), forState: .Normal)
        button.backgroundColor = UIColor.darkGrayColor()
        button.tintColor = UIColor.yepTintColor()
        button.addTarget(self, action: "trySendVoiceMessageBegin", forControlEvents: UIControlEvents.TouchDown)
        button.addTarget(self, action: "trySendVoiceMessageEnd", forControlEvents: UIControlEvents.TouchUpInside)
        button.addTarget(self, action: "trySendVoiceMessageCancel", forControlEvents: UIControlEvents.TouchUpOutside)
