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:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user