ios - What should be in View Controllers and what should be in Views? -


I'm beginning to develop an iOS app I have trouble understanding MVC (model-view-controller) design pattern Has been there. I thought I was doing it down, but the more I read, the more I get confused. I do not know whether it should be an iOS specific question or if there is only one for every use of MVC. I am not using Storyboard BTW, I want to do it all programmatically.

I believe that I understand the fundamental relationship between the controllers and the model, it is different from the view and the controllers which I do not get. Let's say I want to create a UIButton and display it on the screen. Should I start the button in the controller or view? Should the controller be displayed, right? Do not you just call to display that scene and do not worry about creating buttons in the controller? View what I understand, see Controller are only controllers and therefore do not be seen , see be do not seem to be that most people do everything about the bus in view controllers I think my question goes down to what code goes?

  • C (on the controller)
  • In the MVC pattern of the code is part of the controller.
  • One view

  • < P>

    / Strong> An object that has been dragged to the screen, it can also include other views (subviews) that are inside it and proceed with it. Get the event and change their view position to a response. Are silent, and do not know the structure of your application, and are asked to display themselves in just a few states.

    A visual controller on the screen directly The picture can not be loaded, it manages a group of visible objects View Controller usually has a single view with many subviews. Visual Controller manages the status of these views. A visual control It is smart, and has the knowledge of the internal workings of your application. This dumb scene tells the objects what to do and how to show yourself. A visual controller is the glue between your overall application and the screen. This controls the views which are in accordance with the logic of your application

    View the controller View the controller is an important link between the data of the app and its visual presence. Whenever an iOS app displays the user interface, the content displayed is managed by a view controller or view controllers coordinating with each other. So, see, the controllers provide the skeleton framework on which you build your apps. IOS provides several built-in visual controller classes to support pieces of user interface, such as navigation and tab bars, as part of the development of the app, to display specific content for your app, Also apply more custom controls.


    Comments