• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New programmer of IOS: What are View Controllers?

 
Mohammad Ashari Rahman
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

Please explain to me with clear demonstration What are View Controllers?


thanks
 
Rodion Gork
Ranch Hand
Posts: 47
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! It's hard to understand what "clear" means for you.

Perhaps you've heard about Model-View-Controller idea? In short it is like this - the part of your program which is responsible for displaying information to user is logically split into:

- Views - think of them as simple templates which could be stuffed with necessary data;
- Models - data containers, some plain objects or arrays simply containing all data you want to inject into Views;
- Controllers - some classes or just methods which take care of preparing Models.

For example if I have a page with a list of users, then here is a template - some set of styles and layouts for this list, then there are data, for example an array of objects each representing single user (with the name and URL to his profile for example) an there is a code which, for example, checks whether you are allowed to see the list at all, requests the user names from one database table, then their urls from another table, then glues them together to create "Model".

Now back to your question. In IOS programming View Controller is a thing resembling this ideology. In short it is something which helps you to prepare your data and serve it to be displayed.

This article looks like it contains detailed enough overview of them. Feel free to ask if you feel that some specific part of their explanation look vague to you...
 
Mohammad Ashari Rahman
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the explanation and link..the site should be helpful
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic