From 2f17a8216ddeff7ee77f37f28264dc63e38cb0e6 Mon Sep 17 00:00:00 2001 From: Piotr Date: Fri, 1 Jun 2018 12:58:51 +0200 Subject: [PATCH] added possibility to not save photo in gallery --- .../ViewController/CameraViewController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ALCameraViewController/ViewController/CameraViewController.swift b/ALCameraViewController/ViewController/CameraViewController.swift index d9e07099..181f4e03 100644 --- a/ALCameraViewController/ViewController/CameraViewController.swift +++ b/ALCameraViewController/ViewController/CameraViewController.swift @@ -158,15 +158,18 @@ open class CameraViewController: UIViewController { }() private let allowsLibraryAccess: Bool - + private let savePhotoInGallery: Bool + public init(croppingParameters: CroppingParameters = CroppingParameters(), allowsLibraryAccess: Bool = true, + savePhotoInGallery: Bool = true, allowsSwapCameraOrientation: Bool = true, allowVolumeButtonCapture: Bool = true, completion: @escaping CameraViewCompletion) { self.croppingParameters = croppingParameters self.allowsLibraryAccess = allowsLibraryAccess + self.savePhotoInGallery = savePhotoInGallery self.allowVolumeButtonCapture = allowVolumeButtonCapture super.init(nibName: nil, bundle: nil) onCompletion = completion @@ -519,7 +522,7 @@ open class CameraViewController: UIViewController { let spinner = showSpinner() cameraView.preview.isHidden = true - if allowsLibraryAccess { + if savePhotoInGallery && allowsLibraryAccess { _ = SingleImageSaver() .setImage(image) .onSuccess { [weak self] asset in