From f0340013cc1e119a685f67125884b0ce6628074d Mon Sep 17 00:00:00 2001 From: Simon Leonhardt Date: Mon, 7 Dec 2015 23:44:41 +0000 Subject: [PATCH] allow disabling of responding to device orientation changes --- camera/CameraManager.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camera/CameraManager.swift b/camera/CameraManager.swift index 22d1037..7dd5887 100644 --- a/camera/CameraManager.swift +++ b/camera/CameraManager.swift @@ -57,6 +57,8 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate { /// Property to determine if manager should write the resources to the phone library. Default value is true. public var writeFilesToPhoneLibrary = true + + public var shouldRespondToOrientationChanges = true /// The Bool property to determine if current device has front camera. public var hasFrontCamera: Bool = { @@ -533,7 +535,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate { } private func _startFollowingDeviceOrientation() { - if !cameraIsObservingDeviceOrientation { + if shouldRespondToOrientationChanges && !cameraIsObservingDeviceOrientation { NSNotificationCenter.defaultCenter().addObserver(self, selector: "_orientationChanged", name: UIDeviceOrientationDidChangeNotification, object: nil) cameraIsObservingDeviceOrientation = true }