ReadMe.md

# IconCollection
 
IconCollection is a Cocoa sample application that demonstrates how to use NSCollectionView along with NSWorkspace and named images to determine its content.  
 
Since creating an NSCollectionView object yields multiple top-level nib objects, it is recommended that you build a separate nib file for each NSCollectionView.   Doing so will make nib object management easier in the long run.  This sample illustrates this point by leveraging the capabilities of NSViewController, an efficient way to factor and manage your nib files based on views.
 
## Using the Sample
 
Simply build and run the sample using Xcode.  Use the window's toolbar items to manipulate the contents of the collection view.
 
1) Ascending/Descending sort order -
    Affects the collection view's sort order indirectly by setting the NSArrayController sort descriptors.
2) Alternate colors -
    Set on the collection view's background colors (alternate colors) by calling:
        - (void)setBackgroundColors:(NSArray *)colors;
    If alternate colors is turned off, the NSCollectionView's enclosing scroll view draws its background using NSGradient.
3) Searching - 
    Changes what the collection view displays based on the icon display name indirectly by setting the NSArrayController's filterPredicate.
4) Uses NSBox "Transparent" binding to affect the collection view's selection appearance.
5) Collection view selection -
    A text label binds to the array controller selection to detect selection changes.
    This is done by binding to MyWindowController,
        model key path = "viewController.arrayController.selection.name".
    It also overrides both "Multiple Values Placeholder" and "No Selection Placeholder" for this this value binding.
 
## Requirements
 
### Build
 
Xcode 6.0 or later; OS X 10.10 SDK or later
 
### Runtime
 
OS X 10.8 or later
 
## Packaging List
 
AppDelegate.m
AppDelegate.h
NSApp's main delegate, instructed to quit when the last window closes, and helps open the sample's ReadMe from the Help menu.
 
MyWindowController.h
MyWindowController.m
The NSWindowController object for the sample's main window.
 
MyViewController.h
MyViewController.m
The view controller based on NSViewController which manages all aspects of the collection view.  It owns "Collection.xib" as the File's Owner.
 
IconViewPrototype.xib
The nib file containins the collection view's prototype and view; the File's Owner is the NSCollectionViewItem class.
 
MainMenu.xib
The nib file for the app's delegate, window controller and menus.
 
Collection.xib
The nib file containing all necessary objects for managing the NSCollectionView.  It contains the array controller; the File's Owner is the NSViewController class.
 
icons.plist
A property list consisting of an array if dictionary objects describing the collection items.  This file is read by MyViewController to populate its array controller.
 
 
Copyright (C) 2007-2014 Apple Inc. All rights reserved.