AmericanWhitewater / aw-ios

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

Change Filter active filter type to an enum #244

Closed yeahphil closed 3 years ago

yeahphil commented 3 years ago

Filter kind is a toggle -- you can either filter by one or the other, not both. Currently this state is stored in two Bools, showDistanceFilter and showRegionFilter, which are meant to be kept in sync. That's error prone and it's not clear they can't both be true/false. This should be an enum, something like:

    enum ActiveType {
        case distance
        case region
    }

    var activeType: ActiveType
Gregliest commented 3 years ago

Fixed by https://github.com/AmericanWhitewater/aw-ios/pull/250