Skip to content

Instantly share code, notes, and snippets.

@saikat
Created May 12, 2009 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saikat/110693 to your computer and use it in GitHub Desktop.
Save saikat/110693 to your computer and use it in GitHub Desktop.
widgetsCollection = [[CPCollectionView alloc] initWithFrame:bounds];
[widgetsCollection setMinItemSize:CGSizeMake(100, 100)];
[widgetsCollection setMaxItemSize:CGSizeMake(100, 100)];
[widgetsCollection setAutoresizingMask:CPViewWidthSizable];
[widgetsCollection setDelegate:self];
var itemPrototype = [[CPCollectionViewItem alloc] init];
[itemPrototype setView:[[WidgetView alloc] initWithFrame:CGRectMakeZero()]];
[widgetsCollection setItemPrototype:itemPrototype];
var widget = [[TextWidget alloc] initWithFrame:CGRectMake(0, 0, 90.0, 90.0)];
var widget1 = [[TextWidget alloc] initWithFrame:CGRectMake(0, 0, 90.0, 90.0)];
var widget2 = [[TextWidget alloc] initWithFrame:CGRectMake(0, 0, 90.0, 90.0)];
widgets = [widget, widget1, widget2];
[widgetsCollection setContent:widgets];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment