Make it work

This commit is contained in:
Sami Samhuri 2023-02-05 13:59:02 -08:00
parent 848561c177
commit 435c8a40c5
No known key found for this signature in database
GPG key ID: 4B4195422742FC16
4 changed files with 22 additions and 6 deletions

View file

@ -1,6 +1,15 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "1.000",
"red" : "1.000"
}
},
"idiom" : "universal"
}
],

View file

@ -10,11 +10,7 @@ import SwiftUI
struct CloudView: View {
// @Stored(in: .entriesStore) var entries
@Binding var entries: [Entry] {
didSet {
countedWords = countWords()
}
}
@Binding var entries: [Entry]
@State var countedWords: [String: Int] = [:]
@ -24,6 +20,15 @@ struct CloudView: View {
@Environment(\.dismiss) var dismiss
init(entries: Binding<[Entry]>, countedWords: [String: Int]? = nil) {
_entries = entries
if let countedWords {
_countedWords = State(wrappedValue: countedWords)
} else {
_countedWords = State(wrappedValue: countWords())
}
}
var body: some View {
var isFirst = true
words.reduce(Text("")) { cloud, word in
@ -35,6 +40,7 @@ struct CloudView: View {
.bold(count > 2)
}
.multilineTextAlignment(.center)
.padding()
.frame(maxWidth: .infinity, maxHeight: .infinity)
.edgesIgnoringSafeArea(.bottom)
.background(Color.blue)

View file

@ -64,7 +64,7 @@ struct ContentView: View {
formView
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.edgesIgnoringSafeArea(isEditing ? .top : .bottom)
.edgesIgnoringSafeArea(isEditing ? [] : .bottom)
.background(Color.blue)
}
}

View file

@ -12,6 +12,7 @@ struct MemoryTreeApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.tint(.white)
}
}
}