Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift Views and View Controllers View Controllers and IBAction

5 Answers

you have to understand two things to understand the module ,

Moduls View Controller

Moduls = > just think it's a place to save any information you will need it in your app , example

if i have array of country names , i will create new class i will called => AppInfo.h / AppInfo.m

now whenever i need this information i will call this class and i will call the array , that mean the class is response to store the informations only , not doing any calculation just storing , so that was only an example storing country on class , but on the real instate of storying country in array , we can store them in database , core data , iCloud and we can call them our modules ,

now that was about modules

about view

whenever your information is displaying , the place for displaying this information is called view

finally is controller ,

As i said view is displaying the information from module but the question is who will call this information from modules to view ?

this we called controller because he is controlling the things between modules and view .

i hope that make help.

As I understand it, a module is a complete piece of code that allows you to do something ideally in one class.. say for example a User class.. that allows you to add/edit/delete/ users.. you would pull that into your project as module so that you don't have to reinvent the wheel (re-write what is available already)

Mr shez , as your example, the clas whose doing Add Edit Delete

This we called controller, but , the place where the data is stored we called model , example of models Core Data, SQlite ..

As I understand it, a module is a complete piece of code that allows you to do something ideally in one class.. say for example a User class.. that allows you to add/edit/delete/ users.. you would pull that into your project as module so that you don't have to reinvent the wheel (re-write what is available already)