Commit 124ec56c by Daniel Dahan

development: added updates to CaptureDelgate organization

parent 321d15fb
...@@ -169,7 +169,7 @@ public protocol CaptureSessionDelegate { ...@@ -169,7 +169,7 @@ public protocol CaptureSessionDelegate {
} }
@objc(CaptureSession) @objc(CaptureSession)
open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { open class CaptureSession: NSObject {
/// A reference to the session DispatchQueue. /// A reference to the session DispatchQueue.
private var sessionQueue: DispatchQueue! private var sessionQueue: DispatchQueue!
...@@ -189,7 +189,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -189,7 +189,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
private var movieOutputURL: URL? private var movieOutputURL: URL?
/// A reference to the AVCaptureSession. /// A reference to the AVCaptureSession.
internal var session: AVCaptureSession! internal private(set) var session: AVCaptureSession!
/// A boolean indicating if the session is running. /// A boolean indicating if the session is running.
open internal(set) var isRunning = false open internal(set) var isRunning = false
...@@ -376,12 +376,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -376,12 +376,7 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
preset = .presetHigh preset = .presetHigh
super.init() super.init()
prepareSession() prepare()
prepareSessionQueue()
prepareActiveVideoInput()
prepareActiveAudioInput()
prepareImageOutput()
prepareMovieOutput()
} }
/// Starts the session. /// Starts the session.
...@@ -674,14 +669,20 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -674,14 +669,20 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
movieOutput.stopRecording() movieOutput.stopRecording()
} }
public func capture(_ captureOutput: AVCaptureFileOutput!, didStartRecordingToOutputFileAt fileURL: URL!, fromConnections connections: [Any]!) { /**
isRecording = true Prepares the view instance when intialized. When subclassing,
delegate?.captureSessionDidStartRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, fileURL: fileURL as NSURL, fromConnections: connections) 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
public func capture(_ captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAt outputFileURL: URL!, fromConnections connections: [Any]!, error: Error!) { when subclassing.
isRecording = false */
delegate?.captureSessionDidFinishRecordingToOutputFileAtURL?(session: self, captureOutput: captureOutput, outputFileURL: outputFileURL as NSURL, fromConnections: connections, error: error) open func prepare() {
prepareSession()
prepareSessionQueue()
prepareActiveVideoInput()
prepareActiveAudioInput()
prepareImageOutput()
prepareMovieOutput()
} }
/// Prepares the sessionQueue. /// Prepares the sessionQueue.
...@@ -781,3 +782,15 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -781,3 +782,15 @@ open class CaptureSession: NSObject, AVCaptureFileOutputRecordingDelegate {
return nil 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 ...@@ -307,9 +307,6 @@ open class NavigationDrawerController: RootController, UIGestureRecognizerDelega
@IBInspectable @IBInspectable
open var isHiddenStatusBarEnabled = true 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 A DepthPreset property that is used to set the depth of the
leftView when opened. leftView when opened.
......
...@@ -41,6 +41,16 @@ open class RootController: UIViewController { ...@@ -41,6 +41,16 @@ open class RootController: UIViewController {
} }
} }
/// 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 A Boolean property used to enable and disable interactivity
with the rootViewController. with the rootViewController.
......
...@@ -52,6 +52,12 @@ open class StatusBarController: RootController { ...@@ -52,6 +52,12 @@ open class StatusBarController: RootController {
/// A reference to the statusBar. /// A reference to the statusBar.
open private(set) lazy var statusBar = View() 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 To execute in the order of the layout chain, override this
method. LayoutSubviews should be called immediately, unless you 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