Open hrdyjan1 opened 2 years ago
I think I know what you meant. is it that unmodified files also got included in the .diff file? but the destination is /dev/null
diff --git a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/DKImagePickerController/DKImagePickerController.swift b/Pods/DKImagePickerController/Sources/DKImagePickerController/DKImagePickerController.swift index 08d335560..7783f94c3 100644 --- a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/DKImagePickerController/DKImagePickerController.swift +++ b/Pods/DKImagePickerController/Sources/DKImagePickerController/DKImagePickerController.swift @@ -63,10 +63,19 @@ open class DKImagePickerController: DKUINavigationController, DKImageBaseManager newValue?.imagePickerController = self } } + + private var _shouldDismissViaUserAction: Bool = false /// false to prevent dismissal of the picker when the presentation controller will dismiss in response to user action. @available(iOS 13.0, *) - @objc lazy public var shouldDismissViaUserAction = false + @objc public var shouldDismissViaUserAction : Bool { + get { + return _shouldDismissViaUserAction + } + set { + _shouldDismissViaUserAction = newValue + } + } /// Forces deselect of previous selected image. allowSwipeToSelect will be ignored. @objc public var singleSelect = false diff --git a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionCamera.swift b/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionCamera.swift deleted file mode 100644 index 616a25092..000000000 --- a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionCamera.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// DKImageExtensionCamera.swift -// DKImagePickerController -// -// Created by ZhangAo on 16/12/2017. -// Copyright © 2017 ZhangAo. All rights reserved. -// - -import Foundation -import DKCamera - -open class DKImageExtensionCamera: DKImageBaseExtension { - - override class func extensionType() -> DKImageExtensionType { - return .camera - } - - override open func perform(with extraInfo: [AnyHashable: Any]) { - guard let didFinishCapturingImage = extraInfo["didFinishCapturingImage"] as? ((UIImage, [AnyHashable : Any]?) -> Void) - , let didCancel = extraInfo["didCancel"] as? (() -> Void) else { return } - - let containsGPSInMetadata = extraInfo["containsGPSInMetadata"] as? Bool ?? false - - let camera = DKCamera() - camera.didFinishCapturingImage = didFinishCapturingImage - camera.containsGPSInMetadata = containsGPSInMetadata - camera.didCancel = didCancel - - self.checkCameraPermission(camera) - - camera.modalPresentationStyle = .fullScreen - self.context.imagePickerController.present(camera) - } - - override open func finish() { - self.context.imagePickerController.dismiss(animated: true) - } - - open func checkCameraPermission(_ camera: DKCamera) { - func cameraDenied() { - DispatchQueue.main.async { - let permissionView = DKPermissionView.permissionView(.camera, - withColors: self.context.imagePickerController.permissionViewColors) - camera.cameraOverlayView = permissionView - } - } - - func setup() { - camera.cameraOverlayView = nil - } - - DKCamera.checkCameraPermission { granted in - granted ? setup() : cameraDenied() - } - } - -} diff --git a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionInlineCamera.swift b/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionInlineCamera.swift deleted file mode 100644 index 08368d562..000000000 --- a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionInlineCamera.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// DKImageExtensionInlineCamera.swift -// DKImagePickerController -// -// Created by ZhangAo on 16/12/2017. -// Copyright © 2017 ZhangAo. All rights reserved. -// - -import Foundation -import DKCamera - -open class DKImageExtensionInlineCamera: DKImageBaseExtension { - - override class func extensionType() -> DKImageExtensionType { - return .inlineCamera - } - - override open func perform(with extraInfo: [AnyHashable: Any]) { - guard let didFinishCapturingImage = extraInfo["didFinishCapturingImage"] as? ((UIImage, [AnyHashable : Any]?) -> Void) - , let didCancel = extraInfo["didCancel"] as? (() -> Void) else { return } - - let containsGPSInMetadata = extraInfo["containsGPSInMetadata"] as? Bool ?? false - - let camera = DKCamera() - camera.didFinishCapturingImage = didFinishCapturingImage - camera.containsGPSInMetadata = containsGPSInMetadata - camera.didCancel = didCancel - - self.checkCameraPermission(camera) - - if (camera as UIViewController) is UINavigationController { - self.context.imagePickerController.present(camera, animated: true) - self.context.imagePickerController.setViewControllers([], animated: false) - } else { - self.context.imagePickerController.setViewControllers([camera], animated: false) - } - } - - override open func finish() { - self.context.imagePickerController.dismiss(animated: true) - } - - open func checkCameraPermission(_ camera: DKCamera) { - func cameraDenied() { - DispatchQueue.main.async { - let permissionView = DKPermissionView.permissionView(.camera) - camera.cameraOverlayView = permissionView - } - } - - func setup() { - camera.cameraOverlayView = nil - } - - DKCamera.checkCameraPermission { granted in - granted ? setup() : cameraDenied() - } - } - -} diff --git a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionPhotoCropper.swift b/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionPhotoCropper.swift deleted file mode 100644 index c29321cc9..000000000 --- a/cocoapods-patch-20220926-22483-v585ga/DKImagePickerController/Sources/Extensions/DKImageExtensionPhotoCropper.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// DKImageExtensionPhotoCropper.swift -// DKImagePickerController -// -// Created by ZhangAo on 28/9/2018. -// Copyright © 2017 ZhangAo. All rights reserved. -// - -import UIKit -import Foundation - -#if canImport(CropViewController) -import CropViewController -#endif - -open class DKImageExtensionPhotoCropper: DKImageBaseExtension { - - open weak var imageEditor: UIViewController? - open var metadata: [AnyHashable : Any]? - open var didFinishEditing: ((UIImage, [AnyHashable : Any]?) -> Void)? - - override class func extensionType() -> DKImageExtensionType { - return .photoEditor - } - - override open func perform(with extraInfo: [AnyHashable: Any]) { - guard let sourceImage = extraInfo["image"] as? UIImage - , let didFinishEditing = extraInfo["didFinishEditing"] as? ((UIImage, [AnyHashable : Any]?) -> Void) else { return } - - self.metadata = extraInfo["metadata"] as? [AnyHashable : Any] - self.didFinishEditing = didFinishEditing - - let imageCropper = CropViewController(image: sourceImage) - imageCropper.onDidCropToRect = { [weak self] image, _, _ in - guard let strongSelf = self else { return } - - if let didFinishEditing = strongSelf.didFinishEditing { - if sourceImage != image { - strongSelf.metadata?[kCGImagePropertyOrientation] = NSNumber(integerLiteral: 1) - } - - didFinishEditing(image, strongSelf.metadata) - - strongSelf.didFinishEditing = nil - strongSelf.metadata = nil - } - } - imageCropper.modalPresentationStyle = .fullScreen - - self.imageEditor = imageCropper - - let imagePickerController = self.context.imagePickerController - let presentedViewController = imagePickerController?.presentedViewController ?? imagePickerController - presentedViewController?.present(imageCropper, animated: true, completion: nil) - } - - override open func finish() { - self.imageEditor?.presentingViewController?.dismiss(animated: true, completion: nil) - } - -}
Hey, this message is more-less warning about the process of creating diff file.
I followed up the instruction, but after all actions, my final diff file was much more bigger than needed. It was necessary to remove most of the code to make it work. If you are curious about more detail, just let me know.