Library / Outcomes & notifications
Warning (needs attention)
Something needs attention but is not fatal: low battery in a session, unsaved changes, weak signal.
import SwiftUI
struct RecordingView: View {
@State private var storageAlmostFull = false
var body: some View {
VStack {
Text("Recording…")
if storageAlmostFull {
Label("Less than 1 minute of storage left",
systemImage: "exclamationmark.triangle.fill")
.foregroundStyle(.orange)
}
}
.sensoryFeedback(.warning, trigger: storageAlmostFull) { _, new in new }
.task {
try? await Task.sleep(for: .seconds(3))
withAnimation { storageAlmostFull = true }
}
}
}