objcio / issue-13-viper

846 stars 188 forks source link

[Question] Views and reusability #5

Open alexito4 opened 10 years ago

alexito4 commented 10 years ago

I really like what this (and other similar) architecture offers but I’m wondering about the reusability of the views and the role of the view controllers. In the majority of the occasions I create custom views and then compose them all in the viewController creating the screen that I want. I would like to see how this is approached in this architecture since I see that the VC/Views are really tied and only can represent one screen. For example how you would handle if we want to use the “Add” view in another place? For example if we want to use the add as a view on top of the table. Thank you!

scottrhoyt commented 9 years ago

I think subclassing is the right answer for you. Create a "Add" viewcontroller superclass that you inherit from in all the cases you need it.