Created
October 23, 2020 20:05
-
-
Save rorodriguez116/b97f8299f20c7a939e00884133c87f13 to your computer and use it in GitHub Desktop.
Stops camera video capture session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// - Tag: Stop capture session | |
public func stop(completion: (() -> ())? = nil) { | |
sessionQueue.async { | |
if self.isSessionRunning { | |
if self.setupResult == .success { | |
self.session.stopRunning() | |
self.isSessionRunning = self.session.isRunning | |
if !self.session.isRunning { | |
DispatchQueue.main.async { | |
self.isCameraButtonDisabled = true | |
self.isCameraUnavailable = true | |
completion?() | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment