Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ljbatwh/c9113644fe68144aff52255abbd938c6 to your computer and use it in GitHub Desktop.
Save ljbatwh/c9113644fe68144aff52255abbd938c6 to your computer and use it in GitHub Desktop.
SwiftUI do not sport multiple alerts on same View

SwiftUI do not sport .alert on same View, even not on the children of View for example

  1. on same view can ont work View.alert().alert()
  2. on the children of View also don't work HStack{ View.alert() }.alert()

Workaround

  1. in one alert handle two different logic View.alert(a||b)

  2. on parallel view HStack{ View1.alert View2.alert }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment