Integrated the RecordingService and the TranscribingService protocols into the RecordingView view in the Recording package target.
This commit is contained in:
@@ -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()
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user