Skip to content

Instantly share code, notes, and snippets.

@pkluz
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkluz/bf4721d2d96db72ce3b0 to your computer and use it in GitHub Desktop.
Save pkluz/bf4721d2d96db72ce3b0 to your computer and use it in GitHub Desktop.
class CameraView: UIView {
override class func layerClass() -> AnyClass! {
return object_getClass(AVCaptureVideoPreviewLayer())
}
var captureLayer: AVCaptureVideoPreviewLayer {
return layer as AVCaptureVideoPreviewLayer
}
var captureSession: AVCaptureSession {
get {
return captureLayer.session
}
set {
captureLayer.session = newValue
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment