Commit 124ec56c by Daniel Dahan

development: added updates to CaptureDelgate organization

parent 321d15fb
......@@ -169,7 +169,7 @@ public protocol CaptureSessionDelegate {
}
@objc(CaptureSession)
open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
open class CaptureSession: NSObject {
/// A reference to the session DispatchQueue.
private var sessionQueue: DispatchQueue!
......@@ -189,7 +189,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
private var movieOutputURL: URL?
/// A reference to the AVCaptureSession.
internal var session: AVCaptureSession!
internal private(set) var session: AVCaptureSession!
/// A boolean indicating if the session is running.
open internal(set) var isRunning = false
......@@ -376,12 +376,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
preset = .presetHigh
super.init()
prepareSession()
prepareSessionQueue()
prepareActiveVideoInput()
prepareActiveAudioInput()
prepareImageOutput()
prepareMovieOutput()
prepare()
}
/// Starts the session.
......@@ -673,16 +668,22 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
movieOutput.stopRecording()
}
public func capture(_ captureOutput: AVCaptureFileOutput!, didStartRecordingToOutputFileAt fileURL: URL!, fromConnections connections: [Any]!) {
isRecording = true
delegate?.captureSessionDidStartRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, fileURL: fileURL as NSURL, fromConnections: connections)
}
public func capture(_ captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAt outputFileURL: URL!, fromConnections connections: [Any]!, error: Error!) {
isRecording = false
delegate?.captureSessionDidFinishRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, outputFileURL: outputFileURL as NSURL, fromConnections: connections, error: error)
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepare method
to initialize property values and other setup operations.
The super.prepare method should always be called immediately
when subclassing.
*/
open func prepare() {
prepareSession()
prepareSessionQueue()
prepareActiveVideoInput()
prepareActiveAudioInput()
prepareImageOutput()
prepareMovieOutput()
}
/// Prepares the sessionQueue.
private func prepareSessionQueue() {
......@@ -781,3 +782,15 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
return nil
}
}
extension CaptureSession: AVCaptureFileOutputRecordingDelegate {
public func capture(_ captureOutput: AVCaptureFileOutput!, didStartRecordingToOutputFileAt fileURL: URL!, fromConnections connections: [Any]!) {
isRecording = true
delegate?.captureSessionDidStartRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, fileURL: fileURL as NSURL, fromConnections: connections)
}
public func capture(_ captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAt outputFileURL: URL!, fromConnections connections: [Any]!, error: Error!) {
isRecording = false
delegate?.captureSessionDidFinishRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, outputFileURL: outputFileURL as NSURL, fromConnections: connections, error: error)
}
}
......@@ -307,9 +307,6 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega
@IBInspectable
open var isHiddenStatusBarEnabled = true
/// Sets the statusBar to isHidden or not.
open internal(set) var isStatusBarHidden = false
/**
A DepthPreset property that is used to set the depth of the
leftView when opened.
......
......@@ -40,6 +40,16 @@ open class RootController: UIViewController {
Device.statusBarStyle = value
}
}
/// Device visibility state.
open var isStatusBarHidden: Bool {
get {
return Device.isStatusBarHidden
}
set(value) {
Device.isStatusBarHidden = value
}
}
/**
A Boolean property used to enable and disable interactivity
......
......@@ -52,6 +52,12 @@ open class StatusBarController: RootController {
/// A reference to the statusBar.
open private(set) lazy var statusBar = View()
open override var isStatusBarHidden: Bool {
didSet {
statusBar.isHidden = isStatusBarHidden
}
}
/**
To execute in the order of the layout chain, override this
method. LayoutSubviews should be called immediately, unless you
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment