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
1 stars 0 forks source link

Refactoring: Use Global State Library (similar to Redux) to store widget colors #109

Open Daggerpov opened 1 day ago

Daggerpov commented 1 day ago

Currently, I have this copy-pasted all throughout different views:

    @AppStorage("widgetCustomColorPaletteFirstIndex", store: UserDefaults(suiteName: "group.selectedSettings"))
    private var widgetCustomColorPaletteFirstIndex = "1C7C54"

    @AppStorage("widgetCustomColorPaletteSecondIndex", store: UserDefaults(suiteName: "group.selectedSettings"))
    private var widgetCustomColorPaletteSecondIndex = "E2B6CF"

    @AppStorage("widgetCustomColorPaletteThirdIndex", store: UserDefaults(suiteName: "group.selectedSettings"))
    private var widgetCustomColorPaletteThirdIndex = "DEF4C6"

Ideally, I find a library for Swift that's similar to Redux for React, that'll help me manage global state.