I've been working with mvc design pattern to develop iOS, and I was wondering if I'm doing this right. I've read a lot about MVC, and, in my concept, all information that will be displayed or will change view's characteristics will be stored at the model (as it is the 'knowledge' of my vc). So, in my way designing MVCs, I usually create a mvc to each view that users interact, and I have model objects that manages all 'shared' information across the App, and one singleton to persist some data, the 'UserSession' class. For example:
In my HomeViewController I have different subviews depending the status of my objects, so in this MVC (home) I have a 'presenter' as a model that controls my homeSubview type and their data. When I need to retrieve information from another model object (like user, or whatever object) is my 'presenter model' who do the trick (in this case), and the same happens in another mvc inside the project. My ways is something like:
Controller Model (that communicate with others model if needed) and <'respond' to> Controller then View
So, that looks good to me, but I fell like I'm doing shit with the mvc pattern. Can someone give a opinion?
In advance: sorry about the english. And I appreciate any suggestion/help, Thank you!
Aucun commentaire:
Enregistrer un commentaire