Skip to content

Instantly share code, notes, and snippets.

@b-r-o
Created May 3, 2017 20:33
Show Gist options
  • Save b-r-o/f1f13913c2f3b9afca0b274e7b2e7430 to your computer and use it in GitHub Desktop.
Save b-r-o/f1f13913c2f3b9afca0b274e7b2e7430 to your computer and use it in GitHub Desktop.
Work on a background thread, begin and commit configuration
public func flipCamera() {
sessionQueue.async { [unowned self] in
self.captureSession.beginConfiguration()
// We're going to do all the changes here
self.captureSession.commitConfiguration()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment