Post

Replies

Boosts

Views

Activity

Reply to SwiftUI refresh while alert is visible
Limited work around for the bug is to create a @State var in StdView. @State private var alertVis init(...) { ... self._alertVis = State(initialValue: HNCModel.instance.alertVis) } var body : some View { VStack { ... }.alert("text", isPresented: @alertVis) {...} } Setting HNCModel.alertVis vis showAlert() shows the alert and there is no 'Attempt to present...' warning. But the alert is not auto dismissed when the hncModel alertVis value is set to false.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
3w
Reply to SwiftUI refresh while alert is visible
I am not using UIKit in any way. It is pure SwiftUI. My guess is when the view the alert is displaying changes due to observed properties, the alert FW tries to redisplay the alert , sees it is already visible and emits the warning. I'll try to create a simple example over the next few days.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25