Daggerpov / Quote-Droplet-iOS

iOS app that serves quotes through its feed, search, widgets, and notifications (Available on iOS App Store).
https://apps.apple.com/app/quote-droplet/id6455084603
Other
2 stars 0 forks source link

Bug: `DropletsView.swift`'s top nav bar isn't working after `SelectedPage` enum change #124

Closed Daggerpov closed 3 weeks ago

Daggerpov commented 3 weeks ago

Should be simple. I believe this is due to the int -> enum change, and these tag() modifiers looking for ints (1, 2, 3 for the pages, which I used before). The fix should be to change the .tag() cases to that of the SelectedPage enum type.

    private var topNavBar: some View {
        Picker(selection: $viewModel.selected, label: Text("Picker"), content: {
            Text("Feed").tag(SelectedPage.feed)
            Text("Saved").tag(SelectedPage.saved)
            Text("Recent").tag(SelectedPage.recent)
        })
        .pickerStyle(SegmentedPickerStyle())
    }
Daggerpov commented 3 weeks ago

Fixed with above