tl;dr - I've got a data model class and a Multipeer controller class. I would like to access my data model from the (non-view)Multipeer controller class.
I'm working on a tvOS app that will display data in a certain way. The data is in my class model which has all vars @Published. The Class is declared a @StateObject in my base app file and passed to the views as an .environmentObject. This works fine for accessing/changing values in the data model from any view.
I have another Class defined that establishes a Multipeer Connectivity connection to peers and listens for data to be sent. When the data is sent I decode it into my data model Class. This works fine.
The problem is that I need to stuff these received values into the StateObject data structure that all the views use. I have not successfully been able to do that.
Any suggestions on how to get the data I've received in this one class into the "global" data structure that the Views access?