NimbusKit
1.2.1 - Fork Nimbus on Github - Visit the Nimbus Wiki
The iOS framework that grows only as fast as its documentation
|
The NIActions class provides a generic interface for attaching actions to objects.
NIActions are used to implement user interaction in UITableViews and UICollectionViews via the corresponding classes (NITableViewActions and NICollectionViewActions) in the respective feature. NIActions separates the necessity
The three primary types of actions are:
Actions may be attached to specific instances of objects or to entire classes of objects. When an action is attached to both a class of object and an instance of that class, only the instance action should be executed.
All attachment methods return the object that was provided. This makes it simple to attach actions within an array creation statement.
Actions come in two forms: blocks and selector invocations. Both can be attached to an object for each type of action and both will be executed, with the block being executed first. Blocks should be used for simple executions while selectors should be used when the action is complex.
The following is an example of using NITableViewActions:
Tasks | |
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: |