As a developer I try to keep my code as neat and tidy as possible and to not repeat myself if necessary. I love the idea of seperation of concearns.
I notice when I watch a lot of the videos that functions are created in the struct of the content view. My issue is, that I want all my logic some place else. I have created extensions as viewmodels for my views, but even that has code I would like to pull out because it can be used in different places in my code. Especially when I am dealing with CoreData.
My question is this. I have functions that syncronize data using REST calls, as well as other things I like to keep together. I have created a SWIFT file where I put all these functions in. This works great, but what should be my best practice? I personally like the idea of creating a class object and that object contains all my referenced code for that type.
Example. I have many functions with dealing with users. I sync my users with a REST call. I update my users in CoreData, I authenticate my users, I get the count of the number of users, etc.... I can do all this without a class object, but I like having all of that available within a class. Because it is in a class, I can have private functions that are not available outside the class.
When I watch the videos there isn't a clean object model and I assume this is for ease of learning or is this a standard within swift. One of your videos says to stay away from class and use struct.