A more versatile, faster and lighter replacement for NSCollectionView
Objective-C C
Pull request Compare This branch is 8 commits ahead, 4 commits behind BohemianCoding:master.
Latest commit 7914aef Aug 11, 2011 @aaronbrethorst Merge pull request #1 from zorn/master
Example project now embeds the collection view in a scroll view.
Permalink
Failed to load latest commit information.
Example Example project now has collection view embedded in a scroll view Aug 10, 2011
.gitignore updating gitignore to avoid personal xcode files Aug 10, 2011
BCCollectionView+Dragging.h MetadataFilter works again, and now also with drag-drop and delete su… Feb 8, 2011
BCCollectionView+Dragging.m Adds a -draggingEntered: method for the delegate to implement Jul 28, 2011
BCCollectionView+Keyboard.h Fixes keyboard navigation and live resize issues in BCCollectionView Mar 3, 2011
BCCollectionView+Keyboard.m Zooming, bug fixes and I dunno what more Jul 13, 2011
BCCollectionView+Mouse.h MetadataFilter works again, and now also with drag-drop and delete su… Feb 8, 2011
BCCollectionView+Mouse.m Shift-selection now also selects the items in between Jul 31, 2011
BCCollectionView+Zoom.h Zooming, bug fixes and I dunno what more Jul 13, 2011
BCCollectionView+Zoom.m Zooming, bug fixes and I dunno what more Jul 13, 2011
BCCollectionView.h Zooming, bug fixes and I dunno what more Jul 13, 2011
BCCollectionView.m Merge remote-tracking branch 'upstream/master' Aug 9, 2011
BCCollectionViewDelegate.h Adds delegate methods for lost focus Aug 1, 2011
BCCollectionViewGroup.h Zooming, bug fixes and I dunno what more Jul 13, 2011
BCCollectionViewGroup.m Replaced CHUserDefaults with NSUserDefaults Aug 3, 2011
BCCollectionViewLayoutItem.h Better use of threading to load huge collectionviews smoothyl during … Mar 2, 2011
BCCollectionViewLayoutItem.m Better use of threading to load huge collectionviews smoothyl during … Mar 2, 2011
BCCollectionViewLayoutManager.h Search field can get focus, fullscreen works again, white line remove… Mar 9, 2011
BCCollectionViewLayoutManager.m Zooming, bug fixes and I dunno what more Jul 13, 2011
BCCollectionViewLayoutOperation.h Fixes paging issues, updated images and caching improvements Mar 4, 2011
BCCollectionViewLayoutOperation.m Zooming, bug fixes and I dunno what more Jul 13, 2011
BCGeometryExtensions.h MetadataFilter works again, and now also with drag-drop and delete su… Feb 8, 2011
readme.txt Updated Readme File Mar 2, 2011

readme.txt

# BCCollectionView

BCCollectionView is intended as a replacement for NSCollectionView (and possibly IKImageBrowserView). It is designed to work with a lot of items and only loads the views that it actually needs.

Unlike NSCollectionView, BCCollectionView smoothly displays 300.000+ items.
Every 'cell' in an BCCollectionView is an NSViewController. At the moment these are only uniform; every cell is supposed to be the same NSViewController subclass.

# High-level concept overview of BCCollectionView

- The delegate provides empty NSViewControllers for the BCCollectionView that will be reused as often as needed; you can already style the view in it to a creation degree but the delegate doesn't know yet which item it will be displaying later.

	- (NSViewController *)reusableViewControllerForIconView:(BCCollectionView *)iconView

- Before BCCollectionView shows them, it asks the delegate to populate an NSViewController with an item from its contentArray; this is the time to set labels or images that are dependent on the item its supposed to represent

	- (void)iconView:(BCCollectionView *)iconView willShowViewController:(NSViewController *)viewController forItem:(id)anItem

- When the user scrolls the view, some views will become invisible. BCCollectionView removes them from  view and stores them for later use. The delegate has a chance to unload any item-specific resources the item, possibly to save memory for example or do other kinds of cleanup

	- (void)iconView:(BCCollectionView *)iconView viewControllerBecameInvisible:(NSViewController *)viewController

- If the categories on BCCollectionView are included too, the users can use either mouse or keyboard to select items. By default, BCCollectionView will (for now) just draw a rather ugly bezel under a view if it is selected. The delegate can customise this behaviour by return NO in:

	- (BOOL)iconViewShouldDrawSelections:(BCCollectionView *)iconView

If the delegate also overrides the following two methods it can customise its view to determine how to show a selected item instead:

	- (void)iconView:(BCCollectionView *)iconView updateViewControllerAsSelected:(NSViewController *)viewController forItem:(id)item;
	- (void)iconView:(BCCollectionView *)iconView updateViewControllerAsDeselected:(NSViewController *)viewController forItem:(id)item;

Note. Do not use the following methods to style viewControllers. They are intended to inform the delegates of changes in the selection. Using these methods to style the viewControllers might break when the views are being reused at a later point.

	- (BOOL)iconView:(BCCollectionView *)iconView shouldSelectItem:(id)anItem withViewController:(NSViewController *)viewController;
	- (void)iconView:(BCCollectionView *)iconView didSelectItem:(id)anItem withViewController:(NSViewController *)viewController;
	- (void)iconView:(BCCollectionView *)iconView didDeselectItem:(id)anItem withViewController:(NSViewController *)viewController;

# Groups

The latest addition to BCCollectionView has to with groups. Just like IKImageBrowserView, we can now divide the items into groups. A group is simply a range with a title, and the delegate can supply a custom NSViewController to represent the header.
Groups can be set using the default way to load the BCCollectionView:

	- (void)reloadDataWithItems:(NSArray *)newContent groups:(NSArray *)newGroups emptyCaches:(BOOL)shouldEmptyCaches;

# License

BCCollectionView is licensed under the BSD license