Skip to content

Instantly share code, notes, and snippets.

@mbrandonw
Created June 27, 2019 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrandonw/6d1083a2c75c2671c2fd4b6e8b17b4a5 to your computer and use it in GitHub Desktop.
Save mbrandonw/6d1083a2c75c2671c2fd4b6e8b17b4a5 to your computer and use it in GitHub Desktop.
extension View {
func presentation(_ alert: Alert?) -> some View {
guard let alert = alert else { return AnyView(self) }
let binding = Binding<Bool>.constant(true)
return AnyView(self.presentation(binding) { alert })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment