NimbusKit
1.2.1 - Fork Nimbus on Github - Visit the Nimbus Wiki
The iOS framework that grows only as fast as its documentation
|
The NITableViewActions class provides an interface for attaching actions to objects in a NITableViewModel.
NITableViewModel and NITableViewActions cooperate to solve two related tasks: data representation and user actions, respectively. A NITableViewModel is composed of objects and NITableViewActions 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.
NITableViewActions will apply the correct accessoryType and selectionStyle values to the cell when the cell is displayed using a mechanism known as delegate chaining. This effect is achieved by invoking forwardingTo: on the NITableViewActions instance and providing the appropriate object to forward to (generally self
).
The dataSource property of the table view must be an instance of NITableViewModel.
Tasks | |
Configurable Properties | |
UITableViewCellSelectionStyle | tableViewCellSelectionStyle property |
Forwarding | |
(id< UITableViewDelegate >) | - forwardingTo: |
(void) | - removeForwarding: |
Object State | |
(UITableViewCellAccessoryType) | - accessoryTypeForObject: |
(UITableViewCellSelectionStyle) | - selectionStyleForObject: |
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: |
The cell selection style that will be applied to the cell when it is displayed using delegate forwarding.
By default this is UITableViewCellSelectionStyleBlue.
Sets the delegate that table view methods should be forwarded to.
This method allows you to insert the actions into the call chain for the table view's delegate methods.
Example:
forwardDelegate | The delegate to forward invocations to. |
Removes the delegate from the forwarding chain.
If a forwared delegate is about to be released but this object may live on, you must remove the forwarding in order to avoid invalid access errors at runtime.
forwardDelegate | The delegate to stop forwarding invocations to. |
Returns the accessory type this actions object will apply to a cell for the given object when it is displayed.
object | The object to determine the accessory type for. |
Returns the cell selection style this actions object will apply to a cell for the given object when it is displayed.
object | The object to determine the selection style for. |