diff --git a/MemoryTree/Assets.xcassets/AccentColor.colorset/Contents.json b/MemoryTree/Assets.xcassets/AccentColor.colorset/Contents.json index eb87897..97650a1 100644 --- a/MemoryTree/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/MemoryTree/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,6 +1,15 @@ { "colors" : [ { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, "idiom" : "universal" } ], diff --git a/MemoryTree/CloudView.swift b/MemoryTree/CloudView.swift index 7342da2..c59e3b4 100644 --- a/MemoryTree/CloudView.swift +++ b/MemoryTree/CloudView.swift @@ -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) diff --git a/MemoryTree/ContentView.swift b/MemoryTree/ContentView.swift index 0baec7d..323b456 100644 --- a/MemoryTree/ContentView.swift +++ b/MemoryTree/ContentView.swift @@ -64,7 +64,7 @@ struct ContentView: View { formView } .frame(maxWidth: .infinity, maxHeight: .infinity) - .edgesIgnoringSafeArea(isEditing ? .top : .bottom) + .edgesIgnoringSafeArea(isEditing ? [] : .bottom) .background(Color.blue) } } diff --git a/MemoryTree/MemoryTreeApp.swift b/MemoryTree/MemoryTreeApp.swift index d644ab5..80c6876 100644 --- a/MemoryTree/MemoryTreeApp.swift +++ b/MemoryTree/MemoryTreeApp.swift @@ -12,6 +12,7 @@ struct MemoryTreeApp: App { var body: some Scene { WindowGroup { ContentView() + .tint(.white) } } }