AmericanWhitewater / aw-ios

American Whitewater's iOS app
5 stars 2 forks source link

Alerts refactor #251

Closed yeahphil closed 3 years ago

yeahphil commented 3 years ago

This PR removes or refactors most alerts in the app.

It doesn't quite remove DuffekDialog or its external dependency on NYAlertController, leaving a couple uses: a date picker and the runnable range picker, used when reporting a flow or posting a photo.

In several places, an alert was used to deal with an error state the app just shouldn't get into, and I've removed the alert and either refactored to make the state impossible or done some light UI adustment to prevent it. Notes in the commit messages for these.

This PR also refactors and removes the Location singleton, turning it into extensions on CLLocationManager and MKMapView, and a static helper that returns a UIAlertController with a 'location denied' message. When that alert is shown, a view controller is now always responsible for presenting it.

Fixes #229, more or less