Integrated the RecordingService and the TranscribingService protocols into the RecordingView view in the Recording package target.

This commit is contained in:
2026-07-03 21:37:40 +02:00
parent 31b778a36e
commit 376be4940b
4 changed files with 316 additions and 21 deletions
@@ -15,9 +15,19 @@ public struct RecordingView: View {
// MARK: Initializers
/// Creates a recording view in the not-recording state.
public init() {
self.model = .init()
/// Creates a recording view in the not-recording state, attached to the given recording and transcribing services.
///
/// - Parameters:
/// - recorder: The service that captures the audio from a microphone.
/// - transcriber: The service that transcribes the recorded audio into text.
public init(
recorder: any RecordingService,
transcriber: any TranscribingService
) {
self.model = .init(
recorder: recorder,
transcriber: transcriber
)
}
// MARK: Body
@@ -98,5 +108,8 @@ private enum Constant {
#Preview(
"Recording view"
) {
RecordingView()
RecordingView(
recorder: SimulatedRecordingService(),
transcriber: SimulatedTranscribingService()
)
}