         openCameraButton.setTitleColor(UIColor.whiteColor(), forState: .Normal)
         openCameraButton.backgroundColor = UIColor.yepTintColor()
         openCameraButton.addTarget(self, action: #selector(RegisterPickAvatarViewController.openPhotoLibraryPicker), forControlEvents: .TouchUpInside)
-
-    }
-    
-    // MARK: Helpers
-    
-    private func deviceWithMediaType(mediaType: String, preferringPosition position: AVCaptureDevicePosition) -> AVCaptureDevice? {
-        let devices = AVCaptureDevice.devicesWithMediaType(mediaType)
-        var captureDevice = devices.first as? AVCaptureDevice
-        for device in devices as! [AVCaptureDevice] {
-            if device.position == position {
-                captureDevice = device
-                break
-            }
-        }
-
-        return captureDevice
     }
 
     // MARK: Actions

        }
    }

    private lazy var sessionQueue: dispatch_queue_t = dispatch_queue_create("session_queue", DISPATCH_QUEUE_SERIAL)

    private lazy var session: AVCaptureSession = {
        let _session = AVCaptureSession()
        _session.sessionPreset = AVCaptureSessionPreset640x480

        return _session
    }()

    private let mediaType = AVMediaTypeVideo

    private lazy var videoDeviceInput: AVCaptureDeviceInput? = {
        guard let videoDevice = self.deviceWithMediaType(self.mediaType, preferringPosition: .Front) else {
            return nil
        }

        return try? AVCaptureDeviceInput(device: videoDevice)
    }()

    private lazy var stillImageOutput: AVCaptureStillImageOutput = {
        let _stillImageOutput = AVCaptureStillImageOutput()
        _stillImageOutput.outputSettings = [AVVideoCodecKey: AVVideoCodecJPEG]
        return _stillImageOutput
    }()

    override func viewDidLoad() {
        super.viewDidLoad()


            }, completion: { newAvatarURLString in
                YepHUD.hideActivityIndicator()

                SafeDispatch.async { [weak self] in

                    YepUserDefaults.avatarURLString.value = newAvatarURLString

                    self?.performSegueWithIdentifier("showRegisterPickSkills", sender: nil)
                }
            })
        }
    }
}

// MARK: UIImagePicker
