You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: firebaseai/FirebaseAIExample/Features/Live/Views/TranscriptView.swift
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,14 @@ struct TranscriptView: View {
20
20
varbody:someView{
21
21
ScrollViewReader{ proxy in
22
22
ScrollView{
23
-
Text(typewriter.text).font(.title3)
23
+
Text(typewriter.text)
24
+
.font(.title3)
24
25
.frame(maxWidth:.infinity, alignment:.leading)
25
26
.transition(.opacity)
26
27
.padding(.horizontal)
27
28
.id("transcript")
28
-
}.onChange(of: typewriter.text, initial:false){ old, new in
29
+
}
30
+
.onChange(of: typewriter.text, initial:false){ old, new in
29
31
proxy.scrollTo("transcript", anchor:.bottom)
30
32
}
31
33
}
@@ -34,9 +36,9 @@ struct TranscriptView: View {
34
36
35
37
#Preview {
36
38
letvm=TypeWriterViewModel()
37
-
TranscriptView(typewriter: vm).onAppear{
38
-
vm
39
-
.appendText(
39
+
TranscriptView(typewriter: vm)
40
+
.onAppear{
41
+
vm.appendText(
40
42
"The sky is blue primarily because of a phenomenon called Rayleigh scattering, where tiny molecules of gas (mainly nitrogen and oxygen) in Earth's atmosphere scatter sunlight in all directions."
0 commit comments