I follow your step but I got error!!
VStack {
Button("LOIGIN") {
loginVm.login()
showAlert = true
}
.alert(isPresented: $showAlert) {
CustomAlertView(///Cannot convert value of type 'CustomAlertView' to closure result type 'Alert'
message: "An error occurred.",
primaryButtonLabel: "OK",
primaryButtonAction: {},
secondaryButtonLabel: nil,
secondaryButtonAction: nil,
image: Image(systemName: "exclamationmark.triangle")
)
}
}