DispatchQueue asyncAfter do the trick too
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
NSAlert.init(error: ...... ).runModal() }
Seems the problem is in the delay.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: