NimbusKit
1.2.1 - Fork Nimbus on Github - Visit the Nimbus Wiki
The iOS framework that grows only as fast as its documentation
|
The NICollectionViewActions class provides an interface for attaching actions to objects in a NICollectionViewModel.
NICollectionViewModel and NICollectionViewActions cooperate to solve two related tasks: data representation and user actions, respectively. A NICollectionViewModel is composed of objects and NICollectionViewActions maintains a mapping of actions to these objects. The object's attached actions are executed when the user interacts with the cell representing an object.
Your delegate implementation can call the listed collectionView: methods in order for the collection view to respond to user actions. Notably shouldHighlightItemAtIndexPath: allows cells to be highlighted only if the cell's object has an attached action. didSelectItemAtIndexPath: will execute the object's attached tap actions.
If you use the delegate forwarders your collection view's data source must be an instance of NICollectionViewModel.
Tasks | |
(BOOL) | - collectionView:shouldHighlightItemAtIndexPath: |
(void) | - collectionView:didSelectItemAtIndexPath: |
Creating Table View Actions | |
(id) | - initWithTarget: |
Mapping Objects | |
(id) | - attachToObject:tapBlock: |
(id) | - attachToObject:detailBlock: |
(id) | - attachToObject:navigationBlock: |
(id) | - attachToObject:tapSelector: |
(id) | - attachToObject:detailSelector: |
(id) | - attachToObject:navigationSelector: |
Mapping Classes | |
(void) | - attachToClass:tapBlock: |
(void) | - attachToClass:detailBlock: |
(void) | - attachToClass:navigationBlock: |
(void) | - attachToClass:tapSelector: |
(void) | - attachToClass:detailSelector: |
(void) | - attachToClass:navigationSelector: |
Object State | |
(BOOL) | - isObjectActionable: |
(id) | + objectFromKeyClass:map: |
Asks the receiver whether the object at the given index path is actionable.
collectionView.dataSource must be a NICollectionViewModel.
Asks the receiver to perform the tap action for an object at the given indexPath.
collectionView.dataSource must be a NICollectionViewModel.