     
 }
 
+// MARK: - UIButton
+
+extension CameraViewController {
+
+    internal func handleFlipButton(_ button: UIButton) {
+        NextLevel.sharedInstance.flipCaptureDevicePosition()
+    }
+    
+    internal func handleFlashModeButton(_ button: UIButton) {
+    }
+    
+    internal func handleDoneButton(_ button: UIButton) {
+        self.endCapture()
+    }
+    
+}
+
 // MARK: - UIGestureRecognizerDelegate
 
 extension CameraViewController: UIGestureRecognizerDelegate {
 
     internal func handleLongPressGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer) {
-        
+        switch gestureRecognizer.state {
+        case .began:
+            self.startCapture()
+            break
+        case .ended:
+            fallthrough
+        case .cancelled:
+            fallthrough
+        case .failed:
+            fallthrough
+        default:
+            self.pauseCapture()
+        }
     }
     
     internal func handleFocusTapGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer) {

        }
        
        // buttons
        self.recordButton = UIButton(type: .custom)
        if let recordButton = self.recordButton {
            recordButton.setImage(UIImage(named: "record_button"), for: .normal)
            recordButton.sizeToFit()
            recordButton.addTarget(self, action: #selector(handleRecordButton(_:)), for: .touchUpInside)
        }
        
        self.flipButton = UIButton(type: .custom)

    internal var gestureView: UIView?
    internal var controlDockView: UIView?

    internal var recordButton: UIImageView?
    internal var flipButton: UIButton?
    internal var flashButton: UIButton?
    internal var saveButton: UIButton?

    internal var longPressGestureRecognizer: UILongPressGestureRecognizer?
    internal var focusTapGestureRecognizer: UITapGestureRecognizer?
    internal var zoomPanGestureRecognizer: UIPanGestureRecognizer?
    internal var flipDoubleTapGestureRecognizer: UITapGestureRecognizer?
