• 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: Creating subviews programmatically ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating subviews programmatically ?


  • Subject: Re: Creating subviews programmatically ?
  • From: Erik Buck <email@hidden>
  • Date: Mon, 26 Nov 2007 11:59:55 -0800 (PST)

I disagree with the previous answers.  I see no problem with 31 subviews from a performance perspective.  Things like cursor rects and event handling will be nicer and simpler if each "day" is its own view.

  I would create a MYCalendarView class that uses a template MYDayControl instance.  The MYCalendarView copies the template MYDayControl instance as many times as needed to populate the calendar.  MYCalendarView should have a -tile method that repositions and re-sizes the MYDayControl instances as needed.  Create the template MYDayControl instance in Interface Builder so that days can bee structured however you want...the MYCalendarView class is reusable with multiple different kinds of MYDayControls.  MYCalendarView could show a work-week or a whole month or a single day and use different specialized MYDayControl instance for each style...

  This opens lots of cool possibilities such as CoreAnimation effects to indicate selection.  The user double clicks a day and it zooms to fill the whole MYCalendarView with a nice animation... moving tasks or events within a day or from day to day could use standard NSView support for drag and drop.  Each MYCalendarView instance could preserve a cached snapshot of itself so that if multiple months are shown at the same time, each moth would look like a miniature preview of itself the same way document icons in the dock show a preview...

  You might even be able to make this work using the now standard NSCollectionView.
  http://developer.apple.com/documentation/Cocoa/Reference/NSCollectionView_Class/Introduction/Introduction.html

_______________________________________________

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

  • Follow-Ups:
    • Re: Creating subviews programmatically ?
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: I do not understand this XCode 3 behaviour
  • Next by Date: Re: error converting HTML into an attributed string
  • Previous by thread: Re: Creating subviews programmatically ?
  • Next by thread: Re: Creating subviews programmatically ?
  • Index(es):
    • Date
    • Thread