|
|
|
|
@ -24,13 +24,11 @@ import SwiftUI |
|
|
|
|
/// Stack Overflow, see https://stackoverflow.com/a/74765430/1558022 |
|
|
|
|
/// |
|
|
|
|
private struct DeferredViewModifier: ViewModifier { |
|
|
|
|
@Environment(\.colorScheme) var colorScheme |
|
|
|
|
|
|
|
|
|
let delay: DispatchTimeInterval |
|
|
|
|
|
|
|
|
|
func body(content: Content) -> some View { |
|
|
|
|
_content(content) |
|
|
|
|
.foregroundStyle(colorScheme == .light ? .white : .black) |
|
|
|
|
.onAppear { |
|
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + delay) { |
|
|
|
|
self.shouldHide = true |
|
|
|
|
@ -54,6 +52,7 @@ extension View { |
|
|
|
|
func toastFormatted() -> some View { |
|
|
|
|
self |
|
|
|
|
.font(.title3) |
|
|
|
|
.foregroundStyle(.black) |
|
|
|
|
.frame(height: 28) |
|
|
|
|
.padding() |
|
|
|
|
.background { |
|
|
|
|
|