Definitely comes down to preference β I'd rather not have the machinery there if I'm not planning on using it. (Although, in practice this is what I'm forced to do.)
The other big issue is that you can't retroactively add Observable to an existing class/3rd party library.
09.12.2024 13:50
π 1
π 0
π¬ 0
π 0
Hmmm, I'm not sure it's so clear cut! The alternatives are to a) create a regular EnvironmentValue and force unwrap the reference, or b) Just conform your service to Observable anyway and then hope you remember to opt-out of observation where necessary (which seems equally foot-gun prone!)
09.12.2024 13:32
π 0
π 0
π¬ 1
π 0
SwiftUI Environment Service
SwiftUI Environment Service. GitHub Gist: instantly share code, notes, and snippets.
Yes, I think we're talking about slightly different use cases. I'm talking about something like this:
gist.github.com/tcldr/965510...
09.12.2024 13:28
π 0
π 0
π¬ 0
π 0
(To be clear, Iβm talking specifically about types/dependencies where you donβt intend to observe any state, just call methods on or pull state in the context of an action.)
09.12.2024 09:24
π 0
π 0
π¬ 0
π 0
Shouldnβt do, because even with an Observable reference, changes to the environment reference do seem to cause the view to recompute. AFAICT, this has nothing to do with the Observable type, just the Environment property wrapper doing its job.
09.12.2024 08:39
π 0
π 0
π¬ 1
π 0
Iβm still not quite sure why we canβt use this mechanism for non-observable reference types, too.
08.12.2024 19:56
π 1
π 0
π¬ 2
π 0
They baited the industry flawlessly. Hats off to Jaguar. One for the marketing textbooks.
03.12.2024 11:16
π 0
π 0
π¬ 0
π 0
Jaguar Type 00 | Copy Nothing Miami
YouTube video by Jaguar
Everyone wetting their pants about a not great Jaguar teaser can eat sh*t (The Daily Mail can drown in it). They made you look tho, didn't they, so whose the sucker!? This vision for the future of electric vehicles is beautiful and bold. Proud of British design. www.youtube.com/watch?v=Zqt7...
03.12.2024 03:05
π 1
π 1
π¬ 1
π 0
Product Designer Mike Lee has open-sourced all his SwiftUI explorations, which is very valuable. github.com/mikelikesdes...
18.11.2024 12:03
π 79
π 18
π¬ 0
π 1
So, letβs see how this platform goes.
10.11.2024 19:12
π 5
π 0
π¬ 0
π 0