 
     }
     
-    private class func checkCamera(completion: (success : Bool) ->()) {
-        let authStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo)
-        if authStatus == AVAuthorizationStatus.Authorized {
-            completion(success: true)
-        }
-        else if authStatus == AVAuthorizationStatus.NotDetermined {
-            AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo,
+    fileprivate class func checkCamera(_ completion: @escaping (_ success : Bool) ->()) {
+        let authStatus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo)
+        if authStatus == AVAuthorizationStatus.authorized {
+            completion(true)
+        }
+        else if authStatus == AVAuthorizationStatus.notDetermined {
+            AVCaptureDevice.requestAccess(forMediaType: AVMediaTypeVideo,
                 completionHandler: { (granted : Bool) -> Void in
-                completion(success: granted)
+                completion(granted)
             })
         }
         else{
-            completion(success: false)
-        }
-
-    }
-    
-    private class func checkAlbum(completion: (success : Bool) ->()) {
+            completion(false)
+        }
+
+    }
+    
+    fileprivate class func checkAlbum(_ completion: @escaping (_ success : Bool) ->()) {
         let authStatus = PHPhotoLibrary.authorizationStatus()
         
-        if authStatus == PHAuthorizationStatus.Authorized {
-            completion(success: true)
-        }else if authStatus == PHAuthorizationStatus.NotDetermined {
+        if authStatus == PHAuthorizationStatus.authorized {
+            completion(true)
+        }else if authStatus == PHAuthorizationStatus.notDetermined {
             
             PHPhotoLibrary.requestAuthorization({ (status) -> Void in
                 
-                if status == PHAuthorizationStatus.Authorized {
-                    completion(success: true)
+                if status == PHAuthorizationStatus.authorized {
+                    completion(true)
                 }else{
-                    completion(success: false)
+                    completion(false)
                 }
             })
             
         }else {
-            completion(success: false)
-        }
-    
-    }
-    
-    private class func notPermission(controller : UIViewController, completion : (image: UIImage?,
-        status : GEImagePickerStatus)->()){
+            completion(false)
+        }
+    
+    }
+    
+    fileprivate class func notPermission(_ controller : UIViewController, completion : @escaping (_ image: UIImage?,
+        _ status : GEImagePickerStatus)->()){
     
         let alert = UIAlertController(title: "Attention",
             message: "You don't have permission for accessing to Camera/Library\nGo to settings in order to let the app use them.",
-            preferredStyle: UIAlertControllerStyle.Alert)
+            preferredStyle: UIAlertControllerStyle.alert)
         
         
         alert.addAction(UIAlertAction(title: "Cancel",
-            style: UIAlertActionStyle.Cancel,
+            style: UIAlertActionStyle.cancel,
             handler: { (action) -> Void in
                 
-                completion(image: nil, status: GEImagePickerStatus.NotPermission)
+                completion(nil, GEImagePickerStatus.notPermission)
         }))
         alert.addAction(UIAlertAction(title: "Go",
-            style: UIAlertActionStyle.Default,
+            style: UIAlertActionStyle.default,
             handler: { (action) -> Void in
                 
-                UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!)
+                UIApplication.shared.openURL(URL(string: UIApplicationOpenSettingsURLString)!)
         }))
         
-        controller.presentViewController(alert, animated: true, completion: nil)
+        controller.present(alert, animated: true, completion: nil)
 
     }
     

                    finalImage = editingInfo![UIImagePickerControllerOriginalImage] as? UIImage
                }
                
                self.callback!(image: finalImage!,status: GEImagePickerStatus.OK)
            }
        }
    }
    
    func imagePickerControllerDidCancel(picker: UIImagePickerController) {
        
        picker.dismissViewControllerAnimated(true) { () -> Void in
            
            if self.callback != nil {
                self.callback!(image: nil,status: GEImagePickerStatus.Cancelled)
            }
        }
    }

                            }))
            
                            actionSheet.addAction(UIAlertAction(title: "Saved Photos Album",
                                style: UIAlertActionStyle.default,
                                handler: { (action) -> Void in
                                    
                                self.pickImage(GEImagePickerSource.savedPhotosAlbum,
                                    whereViewController: whereViewController,
                                    editMode: editMode,
                                    completion: completion)
