     }
 
     @IBAction func tryOpenCamera(sender: UIButton) {
-
-        AVCaptureDevice.requestAccessForMediaType(mediaType, completionHandler: { (granted) -> Void in
-            if granted {
-                self.openCamera()
-
-            } else {
-                self.alertCanNotOpenCamera()
-            }
+        proposeToAccess(.Camera, agreed: {
+            self.openCamera()
+
+        }, rejected: {
+            self.alertCanNotOpenCamera()
         })
     }
 

            }
        }

        PHPhotoLibrary.requestAuthorization { status in

            switch status {

            case .Authorized:
                openCameraRoll()

            default:
                self.alertCanNotAccessCameraRoll()
            }
        }
    }

    func uploadAvatarAndGotoPickSkills() {


    @IBAction func tryOpenCameraRoll(sender: UIButton) {

        let openCameraRoll: ProposerAction = { [weak self] in
            if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.SavedPhotosAlbum) {
                let imagePicker = UIImagePickerController()
                imagePicker.delegate = self
