April 2020
Beginner
316 pages
8h 20m
English
So far, we've learned what @EnvironmentObject has to offer and we have to admit that it's pretty powerful, but as with most things in software development, we need to be careful not to over-engineer our solution just because something is easy to do.
It's very tempting to simply use @EnvironmentObject to store all data passed between views; we could even store a dictionary in there with a key to match our view name and a value to hold some values.
However, those of you who are familiar with the singleton pattern will know all too well that this approach can soon become messy and far too complicated than it needs to be.
When choosing to use @EnvironmentObject, don't think about why you want to use it, but more ...
Read now
Unlock full access