We provide two
RecorderProtocol implementations that you can choose from depending on your case.
Using them is a bit different but they all share the same functionality from the
- A default implementation called
- A UIKit-specific implementation called
RecorderViewController. It conforms to the recorder protocol by delegating to a
Recorderunder the hood.
The default recorder
Recorder is the low level implementation that, unlike the others, is detached from
the UI. You will typically hold the default instance in the "view model" layer of your app.
let recorder = Recorder(
Attaching to the UI
In order to show the UI you must add the preview layer,
Recorder.videoPreviewLayer to some View in your hierarchy:
The recorder ViewController
RecorderViewController is a UIKit-based implementation of our recorder protocol, which does what was stated above - adds the preview layer as a child element covering the full size of the controller.
let recorder = RecorderViewController(
After creating the view controller, it can be added to your hierarchy and it will show the camera preview.
We don't offer any SwiftUI utility at the moment, but it is trivial to implement a SwiftUI recorder based on