Issue with SwiftUI Alert Freezing in AUv3 Extension Project on Mac Catalyst

Hello,

I am working on an AUv3 extension project using SwiftUI in Xcode and have encountered a peculiar issue when implementing a simple alert on Mac Catalyst. The code is straightforward; it's merely an alert triggered by a button within a SwiftUI view. Here's the relevant portion of the code:

import SwiftUI

struct SwiftAUv3ExtensionMainView: View {
    var parameterTree: ObservableAUParameterGroup
    @State var showingAlert = false
    
    var body: some View {
        VStack {
            ParameterSlider(param: parameterTree.global.gain)
            Button(action: {showingAlert = true}, label: {
                Text("Button")
            })
        }
        .alert("Alert", isPresented: $showingAlert, actions: {}, message: { Text("Message") })
    }
}

The problem arises when this alert is displayed and subsequently closed. Upon closing the alert, the cursor turns into a spinning rainbow and the app freezes for several seconds. Additionally, Xcode's console displays the warning: -[NSWindow makeKeyWindow] called on _NSAlertPanel which returned NO from -[NSWindow canBecomeKeyWindow].

I am looking for insights or solutions to address this issue. Has anyone else experienced similar problems with SwiftUI alerts in AUv3 extension projects, especially when using Mac Catalyst? Any advice or suggestions would be greatly appreciated.

Thank you.

Issue with SwiftUI Alert Freezing in AUv3 Extension Project on Mac Catalyst
 
 
Q