From c9ac47470f0c4fb3b2c3f8e1717516dc760bd085 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 5 Feb 2023 12:28:39 -0800 Subject: [PATCH] Even more cloudier --- MemoryTree/CloudView.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/MemoryTree/CloudView.swift b/MemoryTree/CloudView.swift index 600ceb3..7342da2 100644 --- a/MemoryTree/CloudView.swift +++ b/MemoryTree/CloudView.swift @@ -25,14 +25,16 @@ struct CloudView: View { @Environment(\.dismiss) var dismiss var body: some View { - VStack { - ForEach(words, id: \.self) { word in - let count = countedWords[word, default: 1] - Text(word) - .font(fontForCount(count)) - .bold(count > 2) - } + var isFirst = true + words.reduce(Text("")) { cloud, word in + defer { isFirst = false } + let count = countedWords[word, default: 1] + let bullet = (isFirst ? Text("") : Text(" • ")) + return cloud + bullet + Text(word) + .font(fontForCount(count)) + .bold(count > 2) } + .multilineTextAlignment(.center) .frame(maxWidth: .infinity, maxHeight: .infinity) .edgesIgnoringSafeArea(.bottom) .background(Color.blue)