Yesterday I was telling you about the many preferences / settings of @IceCubesApp, today I'll show you the code
@dimillian @IceCubesApp never thought to embed app storage in an observable object before. How do you go about accessing them outside the view, or do you not need to?
@phill @dimillian @IceCubesApp unfortunately AppStorage does not currently work in Observable on iOS 17.
@dimillian @alpennec @IceCubesApp that's neat, thanks for sharing.
I went down the route of mimicking environment keys, which works great, but not sure it was worth all the time/effort replicating AppStorage 😛
@dimillian @alpennec @IceCubesApp I used to use the environment exclusively (2nd photo), but views weren't notified of changes. This was fine for most of my views, but some needed to be live.
For these I have a @Setting property wrapper mapped to a StateObject that listens for changes in the defaults. I switch between the two depending on what I need, but they all utilise the same keys.
@phill @dimillian @IceCubesApp can you share the Setting property wrapper?
@phill @alpennec @IceCubesApp so you inject all of them at the app level and then retrieve like env?