diff --git a/LeCountdown/AppDelegate.swift b/LeCountdown/AppDelegate.swift index aff00e7..251b142 100644 --- a/LeCountdown/AppDelegate.swift +++ b/LeCountdown/AppDelegate.swift @@ -46,6 +46,7 @@ class AppDelegate : NSObject, UIApplicationDelegate { } func applicationDidReceiveMemoryWarning(_ application: UIApplication) { + Conductor.maestro.memoryWarningReceived = true Logger.log("applicationDidReceiveMemoryWarning") FileLogger.log("applicationDidReceiveMemoryWarning") } diff --git a/LeCountdown/Conductor.swift b/LeCountdown/Conductor.swift index f29131c..a550f3c 100644 --- a/LeCountdown/Conductor.swift +++ b/LeCountdown/Conductor.swift @@ -35,6 +35,8 @@ class Conductor: ObservableObject { @Published private (set) var liveTimers: [LiveTimer] = [] + @Published var memoryWarningReceived: Bool = false + init() { self.currentCountdowns = Conductor.savedCountdowns self.currentStopwatches = Conductor.savedStopwatches diff --git a/LeCountdown/Views/ContentView.swift b/LeCountdown/Views/ContentView.swift index 9e916ec..5af2202 100644 --- a/LeCountdown/Views/ContentView.swift +++ b/LeCountdown/Views/ContentView.swift @@ -83,6 +83,11 @@ struct ContentView: View { // .environment(\.managedObjectContext, viewContext) // }) .toolbar { + if Conductor.maestro.memoryWarningReceived { + ToolbarItemGroup(placement: .navigationBarTrailing) { + Image(systemName: "circle.fill").font(.caption2).foregroundColor(.orange) + } + } MainToolbarView(isEditing: self.$isEditing) } .onAppear {