take a look at the AVCam sample code. It is for iOS, but most of it translates pretty well to macOS. You build a AVCaptureSession using your AVCaptureDevice, and set up a AVCapturePreviewLayer so you can see what it is producing.
There is also older sample code kicking around which is more Mac-oriented, and some third-party samples on GitHub. Try searching for "macOS AVCaptureSession sample"
Topic:
Programming Languages
SubTopic:
Swift
Tags: