Propagated the Transcription type and locale binding through the RecordingView view and its view model in the Recording package target.

This commit is contained in:
2026-07-04 12:11:24 +02:00
parent 68c070948e
commit 20cbda7b27
6 changed files with 47 additions and 30 deletions
@@ -15,6 +15,9 @@ extension ContentView {
// MARK: Properties
/// The locale of the spoken language to transcribe.
var locale: Locale = .current
/// The transcription currently presented in the modal sheet, or `nil` when none is shown.
var transcription: Transcription?
@@ -28,13 +31,13 @@ extension ContentView {
// MARK: Methods
/// Handles the transcribed text of a processed recording, presenting it in the modal sheet.
/// Handles the transcription of a processed recording, presenting it in the modal sheet.
///
/// - Parameter text: The transcribed text of the processed recording.
/// - Parameter transcription: The transcription of the processed recording.
func received(
_ text: String
_ transcription: Transcription
) {
transcription = .init(text: text)
self.transcription = transcription
}
/// Handles the dismissal of the modal sheet.
+4 -3
View File
@@ -23,9 +23,10 @@ struct ContentView: View {
NavigationStack {
RecordingView(
recorder: model.recorder,
transcriber: model.transcriber
) { text in
model.received(text)
transcriber: model.transcriber,
locale: $model.locale,
) { transcription in
model.received(transcription)
}
.navigationTitle("view.recording.navigation.title")
#if !os(macOS)