Only one alert may be attached to a view. To avoid collisions and clutter, one could handle alerts centrally using the func alert<Item>(item: Binding<Item?>...
modifier on a senior view.
The init above accepts a binding for any identifiable object and provides a closure to map it into multiple types of Alert
views. To minimize code in that closure and simplify call sites, below is a minimalist example wrapper and implementation. This isn’t complex at all, but while the API is decent it could be simpler.
@main
struct SomeApp: App {
@StateObject var coordinator: AppCoordinator