allow disabling of responding to device orientation changes
This commit is contained in:
parent
bf9add31dd
commit
f0340013cc
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue