Solved

Switching to a possible 10 views - how many view controllers?

Posted on 2010-09-01
1
527 Views
Last Modified: 2013-11-25
I'm writing a "guide" style app which will display static content dependant on what category the user selects. From the main menu there is an option of reading/displaying 10 different views each loaded from 10 different buttons. Each view will contain text and some graphics (nothing heavy).

What's the best way of doing this?

Should I have one view controller for all or one view controller for each view?
0
Comment
Question by:nickedwards
1 Comment
 
LVL 5

Accepted Solution

by:
xdomains earned 500 total points
Comment Utility
You can decide to select between a single view controller or multiple view controllers based on these -

a) Data that the model is going to handle: If the data can be seggregated to be independent for each views, then you can go for multiple models, views and controllers. If you have any interdependencies between the data, then it best not to split them across models

b) Even if you have a single data model, it is perfectly fine to have multiple view-controllers. This is much cleaner, and you will have excellent control on what you want to do with the view. This will be highly maintainable and light weight while executing, because only the necessary views need to be loaded. You should keep a controller for each view, again for the maintainability aspects. This will also enable you to abstract and encapsulate the business logic behind the views.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now