Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

added possibility to not save photo in gallery #267

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down