         }
     }
     
+    private func flashModelFromUserDefaults() -> AVCaptureFlashMode {
+        let rawValue = NSUserDefaults.standardUserDefaults().integerForKey("DKCamera.flashModel")
+        return AVCaptureFlashMode(rawValue: rawValue)!
+    }
+    
+    private func updateFlashModelToUserDefautls(flashModel: AVCaptureFlashMode) {
+        NSUserDefaults.standardUserDefaults().setInteger(flashModel.rawValue, forKey: "DKCamera.flashModel")
+    }
+    
     private func updateFlashButton() {
         struct FlashImage {
             

    private func setupCurrentDevice() {
        if let currentDevice = self.currentDevice {
            
            if currentDevice.isFlashModeSupported(self.flashModel) {
                self.flashButton.hidden = false
                self.updateFlashMode()
            } else {
                self.flashButton.hidden = true
            }

            }
        }
        
        if self.currentDevice == nil || self.currentDevice?.flashAvailable == false {
            return
        }
        
