Skip to content

Commit 6fe2bca

Browse files
committed
Put view modifiers on their own lines
1 parent 9856ef5 commit 6fe2bca

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

firebaseai/FirebaseAIExample/Features/Live/Screens/LiveScreen.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ struct LiveScreen: View {
5757
.padding()
5858
.navigationTitle(viewModel.title)
5959
.navigationBarTitleDisplayMode(.inline)
60-
.background(viewModel.backgroundColor ?? .clear).onDisappear {
60+
.background(viewModel.backgroundColor ?? .clear)
61+
.onDisappear {
6162
Task {
6263
await viewModel.disconnect()
6364
}

firebaseai/FirebaseAIExample/Features/Live/Views/ConnectButton.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,6 @@ extension ButtonStyle where Self == ConnectButtonStyle {
120120
ConnectButton(state: .idle, onConnect: {}, onDisconnect: {})
121121
ConnectButton(state: .connecting, onConnect: {}, onDisconnect: {})
122122
ConnectButton(state: .connected, onConnect: {}, onDisconnect: {})
123-
}.padding(.horizontal)
123+
}
124+
.padding(.horizontal)
124125
}

firebaseai/FirebaseAIExample/Features/Live/Views/ModelAvatar.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,20 @@ struct ModelAvatar: View {
2828
}
2929

3030
var body: some View {
31-
Image("gemini-logo").resizable().aspectRatio(contentMode: .fit).padding().colorMultiply(.black)
31+
Image("gemini-logo")
32+
.resizable()
33+
.aspectRatio(contentMode: .fit)
34+
.padding()
35+
.colorMultiply(.black)
3236
.maskedOverlay {
3337
AngularGradient(
3438
gradient: Gradient(colors: colors),
3539
center: .leading,
3640
startAngle: gradientAngle,
3741
endAngle: gradientAngle + .degrees(360)
3842
)
39-
}.onAppear {
43+
}
44+
.onAppear {
4045
withAnimation(.linear(duration: 10).repeatForever(autoreverses: false)) {
4146
self.gradientAngle = .degrees(360)
4247
}
@@ -52,7 +57,8 @@ extension View {
5257
@ViewBuilder
5358
func maskedOverlay(mask: () -> some View) -> some View {
5459
overlay {
55-
mask().mask { self }
60+
mask()
61+
.mask { self }
5662
}
5763
}
5864
}

firebaseai/FirebaseAIExample/Features/Live/Views/TranscriptView.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ struct TranscriptView: View {
2020
var body: some View {
2121
ScrollViewReader { proxy in
2222
ScrollView {
23-
Text(typewriter.text).font(.title3)
23+
Text(typewriter.text)
24+
.font(.title3)
2425
.frame(maxWidth: .infinity, alignment: .leading)
2526
.transition(.opacity)
2627
.padding(.horizontal)
2728
.id("transcript")
28-
}.onChange(of: typewriter.text, initial: false) { old, new in
29+
}
30+
.onChange(of: typewriter.text, initial: false) { old, new in
2931
proxy.scrollTo("transcript", anchor: .bottom)
3032
}
3133
}
@@ -34,9 +36,9 @@ struct TranscriptView: View {
3436

3537
#Preview {
3638
let vm = TypeWriterViewModel()
37-
TranscriptView(typewriter: vm).onAppear {
38-
vm
39-
.appendText(
39+
TranscriptView(typewriter: vm)
40+
.onAppear {
41+
vm.appendText(
4042
"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."
4143
)
4244
}

firebaseai/FirebaseAIExample/Shared/Views/TipView.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ struct TipView: View {
1919

2020
var body: some View {
2121
VStack(alignment: .leading, spacing: 5) {
22-
Label("Tip", systemImage: "info.circle").bold().foregroundStyle(.blue)
22+
Label("Tip", systemImage: "info.circle")
23+
.bold()
24+
.foregroundStyle(.blue)
2325
Text(text)
24-
.font(.caption).italic()
26+
.font(.caption)
27+
.italic()
2528
}
2629
}
2730
}

0 commit comments

Comments
 (0)