• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dumb question about view controllers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dumb question about view controllers


  • Subject: Re: Dumb question about view controllers
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 04 May 2015 17:50:23 +0200

On 02 May 2015, at 20:18, William Squires <email@hidden> wrote:
> This is sort of in response to the thread, "Parent/child view controllers: when shall we use it?".
>
> Since, in both iOS and Mac OS X, a control IS a view, why don't controls have their own dedicated view controllers? i.e. If I make a new single-view iOS project, and I put a UILabel in the main view, why doesn't Xcode generate a template view controller (code) for the UILabel (that is, UILabelViewController), just like there's a view controller for the main view (usu. ViewController.h and ViewController.m, or - in swift, just ViewController.swift)?
>
> I'm guessing this is because they're built in to the frameworks?

 I think you're unclear about the Model-View-Controller (or more descriptively Model-Controller-View) pattern. View and model classes are intended to be re-usable bits that you set up your application from. Controllers are your application-specific code that glues your re-usable application bits together. Usually, you have one controller for an entire (sub-)hierarchy of view or model classes.

 (NB -- views being by concept re-usable doesn't mean you'll actually re-use them. Just that that is the design goal behind them and how you want to separate the layers)

-- Uli
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Dumb question about view controllers (From: William Squires <email@hidden>)

  • Prev by Date: Re: Parent/child view controllers: when shall we use it?
  • Next by Date: Proper way to perform a task in the future on iOS 7 and 8
  • Previous by thread: Re: Dumb question about view controllers
  • Next by thread: Swift and 10.9 base SDK
  • Index(es):
    • Date
    • Thread