diff --git a/ALCameraViewController.podspec b/ALCameraViewController.podspec index 58b45081..a947b16a 100644 --- a/ALCameraViewController.podspec +++ b/ALCameraViewController.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "ALCameraViewController" - spec.version = "2.0.1" + spec.version = "2.0.2" spec.summary = "A camera view controller with custom image picker and image cropping." spec.source = { :git => "https://github.com/AlexLittlejohn/ALCameraViewController.git", :tag => spec.version.to_s } spec.requires_arc = true diff --git a/ALCameraViewController/ViewController/CameraViewController.swift b/ALCameraViewController/ViewController/CameraViewController.swift index 4bbdb644..f23d25bc 100644 --- a/ALCameraViewController/ViewController/CameraViewController.swift +++ b/ALCameraViewController/ViewController/CameraViewController.swift @@ -284,7 +284,6 @@ open class CameraViewController: UIViewController { cameraView.startSession() addCameraObserver() addRotateObserver() - rotateCameraView() if allowVolumeButtonCapture { setupVolumeControl() diff --git a/ALCameraViewController/Views/CameraView.swift b/ALCameraViewController/Views/CameraView.swift index fb68e64d..0ac18374 100644 --- a/ALCameraViewController/Views/CameraView.swift +++ b/ALCameraViewController/Views/CameraView.swift @@ -59,6 +59,7 @@ public class CameraView: UIView { session.startRunning() DispatchQueue.main.async() { [weak self] in self?.createPreview() + self?.rotatePreview() } } } diff --git a/ALCameraViewController/Views/CropOverlay.swift b/ALCameraViewController/Views/CropOverlay.swift index dde94409..626c1e3b 100644 --- a/ALCameraViewController/Views/CropOverlay.swift +++ b/ALCameraViewController/Views/CropOverlay.swift @@ -199,4 +199,17 @@ internal class CropOverlay: UIView { } } } + + override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + let view = super.hitTest(point, with: event) + + if !isMovable && isResizable && view != nil { + let isButton = cornerButtons.reduce(false) { $1.hitTest(convert(point, to: $1), with: event) != nil || $0 } + if !isButton { + return nil + } + } + + return view + } }