mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-27 15:07:43 +00:00
Remove protocol for orientation mode
This commit is contained in:
parent
a9746bf861
commit
0c4b65f8aa
2 changed files with 9 additions and 11 deletions
|
|
@ -17,17 +17,11 @@ import Foundation
|
||||||
import AVFoundation
|
import AVFoundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
protocol Orientation: class {
|
|
||||||
func getPreviewLayerOrientation() -> AVCaptureVideoOrientation
|
|
||||||
func getVideoOrientation() -> AVCaptureVideoOrientation?
|
|
||||||
func getImageOrientation(forCamera: SwiftyCamViewController.CameraSelection) -> UIImageOrientation
|
|
||||||
func start()
|
|
||||||
func stop()
|
|
||||||
}
|
|
||||||
|
|
||||||
class DeviceOrientation : Orientation {
|
class Orientation {
|
||||||
var deviceOrientation : UIDeviceOrientation?
|
private var deviceOrientation : UIDeviceOrientation?
|
||||||
var shouldUseDeviceOrientation: Bool = false
|
var shouldUseDeviceOrientation: Bool = false
|
||||||
|
|
||||||
|
|
||||||
func start() {
|
func start() {
|
||||||
self.deviceOrientation = UIDevice.current.orientation
|
self.deviceOrientation = UIDevice.current.orientation
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,11 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
|
|
||||||
/// Sets wether the taken photo or video should be oriented according to the device orientation
|
/// Sets wether the taken photo or video should be oriented according to the device orientation
|
||||||
|
|
||||||
public var shouldUseDeviceOrientation = false
|
public var shouldUseDeviceOrientation = false {
|
||||||
|
didSet {
|
||||||
|
orientation.shouldUseDeviceOrientation = shouldUseDeviceOrientation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Sets whether or not View Controller supports auto rotation
|
/// Sets whether or not View Controller supports auto rotation
|
||||||
|
|
||||||
|
|
@ -245,7 +249,7 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
|
|
||||||
/// Last changed orientation
|
/// Last changed orientation
|
||||||
|
|
||||||
var orientation : Orientation = DeviceOrientation()
|
var orientation = Orientation()
|
||||||
|
|
||||||
/// Boolean to store when View Controller is notified session is running
|
/// Boolean to store when View Controller is notified session is running
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue