Quantcast
Channel: Combine: Asynchronous Programming with Swift - Kodeco Forums
Viewing all articles
Browse latest Browse all 26

Chapter 15.9 EnvironmentObject usage

$
0
0

Screenshot 2022-01-07 at 09.19.04
Here is the moment at the end of the chapter, that describes “you need to add EnvironmentObject to ReaderView”:

  • One as a property - @EnvironmentObject var settings: Settings
  • Second as pass param to SettingView - .environmentObject(self.settings)
    But, even if I’ll not do this - everything works as expected. So, what is the real reason to do this?
    In challenges of 15.10 - yes, you need this, but before I don’t understand why this should be done
    Can you explain, please?

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 26

Trending Articles