Even more cloudier

This commit is contained in:
Sami Samhuri 2023-02-05 12:28:39 -08:00
parent db7cd43658
commit c9ac47470f
No known key found for this signature in database
GPG key ID: 4B4195422742FC16

View file

@ -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)