Hey cool. Thanks for taking the time to write back.
I get it. I'm a frustrating person to help out. I'm new to all of this, and trying really hard to ask for help, which is hard because sometimes the verbage is lost on me. For example instantiate vs initialize. As another example, last year I didn't understand the concept of scope, but knew there was something going on with my code, where some parts of it weren't being picked up by other parts of my code. Trying to describe in writing what I was working through, and struggling with, to an internet forum is not easy when you don't even know the words to use. Added to this, trying to make sense of Apple's documentation is often times a struggle. And I can't tell you how many countless hours I've spent googling for some form of help while I keep getting nowhere. So that's why I'm here. And in spite what I've just said, I do appreciate your help, and the countless others who have guided me over this last year and a half. It has not been easy.
So say for example, when you say instantiate, you clearly don't mean where the object is first established. I think that's initialization. So I'm left thinking you're talking about when it's called into a view. If that's the case, it's here: " @EnvironmentObject var publishedClassContact: PublishedClassContact. That's in my AddAccountView. If that's not correct, let me know.
That's called in my AddAccountView file, because I think I need that in order to run my function to save account entries. Yes it's a class. If I try and refactor I clearly cannot use @EnvironmentObject, so my only option is to use @Published, which then calls for that line of code to be initialized. I've asked for help here before about if the way I'm initializing is proper, and no one seems to be able to tell me. Again, I've struggled with finding out online how to make sense of this.
Here's what I'm trying to do, and maybe this will help shed some light on this. If you've made it this far, thank you very kindly for taking your time here:
I'm trying to use SwiftUI, Core Data, and property wrappers to create an account list. That list has several attributes per entity. And some of those entities need to connect to other entities. I have not had to wrestle with that yet. I will in time though. I'm sure.
My thought is to refactor the logic away from my views, and into classes. The 'PublishedClass' calls are for the entries of data into the account list. For example, some of them are accountAddress, accountPhoneNumber, accountCustomerType etc. That list has those already set as @Published. So again Im trying to have the publishedClass files be separate from the refactor files. Please let me know if this needs clarification. When I use property wrappers, I seem to run into issues, and I think those issues come from my lack of understanding around initializing.
Please let me know what parts of this need clarification.
Thank you again.