NimbusKit
1.2.1 - Fork Nimbus on Github - Visit the Nimbus Wiki
The iOS framework that grows only as fast as its documentation
|
Classes | |
class | NIActions |
The NIActions class provides a generic interface for attaching actions to objects. More... | |
Typedefs | |
typedef BOOL(^ | NIActionBlock )(id object, id target, NSIndexPath *indexPath) |
Functions | |
NIActionBlock | NIPushControllerAction (Class controllerClass) |
Creating Table View Actions | |
(id) | - NIActions::initWithTarget: |
Mapping Objects | |
(id) | - NIActions::attachToObject:tapBlock: |
(id) | - NIActions::attachToObject:detailBlock: |
(id) | - NIActions::attachToObject:navigationBlock: |
(id) | - NIActions::attachToObject:tapSelector: |
(id) | - NIActions::attachToObject:detailSelector: |
(id) | - NIActions::attachToObject:navigationSelector: |
Mapping Classes | |
(void) | - NIActions::attachToClass:tapBlock: |
(void) | - NIActions::attachToClass:detailBlock: |
(void) | - NIActions::attachToClass:navigationBlock: |
(void) | - NIActions::attachToClass:tapSelector: |
(void) | - NIActions::attachToClass:detailSelector: |
(void) | - NIActions::attachToClass:navigationSelector: |
Object State | |
(BOOL) | - NIActions::isObjectActionable: |
(id) | + NIActions::objectFromKeyClass:map: |
For attaching actions to objects.
object | An action was performed on this object. |
target | The target that was attached to the NIActions instance. |
indexPath | The index path of the object. |
Initializes a newly allocated table view actions object with the given target.
This is the designated initializer.
The target is stored as a weak reference internally.
target | The target that will be provided to action blocks and on which selectors will be performed. |
Attaches a tap action to the given object.
A cell with an attached tap action will have its selectionStyle set to tableViewCellSelectionStyle
when the cell is displayed.
The action will be executed when the object's corresponding cell is tapped. The object argument of the block will be the object to which this action was attached. The target argument of the block will be this receiver's target
.
Return NO if the tap action is used to present a modal view controller. This provides a visual reminder to the user when the modal controller is dismissed as to which cell was tapped to invoke the modal controller.
The tap action will be invoked first, followed by the navigation action if one is attached.
object | The object to attach the action to. This object must be contained within an NITableViewModel. |
action | The tap action block. |
Attaches a detail action to the given object.
When a cell with a detail action is displayed, its accessoryType will be set to UITableViewCellAccessoryDetailDisclosureButton.
When a cell's detail button is tapped, the detail action block will be executed. The return value of the block is ignored.
object | The object to attach the action to. This object must be contained within an NITableViewModel. |
action | The detail action block. |
Attaches a navigation action to the given object.
When a cell with a navigation action is displayed, its accessoryType will be set to UITableViewCellAccessoryDisclosureIndicator if there is no detail action, otherwise the detail disclosure indicator takes precedence.
When a cell with a navigation action is tapped the navigation block will be executed.
If a tap action also exists for this object then the tap action will be executed first, followed by the navigation action.
object | The object to attach the action to. This object must be contained within an NITableViewModel. |
action | The navigation action block. |
Attaches a tap selector to the given object.
The method signature for the selector is:
A cell with an attached tap action will have its selectionStyle set to tableViewCellSelectionStyle
when the cell is displayed.
The selector will be performed on the action object's target when a cell with a tap selector is tapped, unless that selector does not exist on the target
in which case nothing happens.
If the selector invocation returns YES then the cell will be deselected immediately after the invocation completes its execution. If NO is returned then the cell's selection will remain.
Return NO if the tap action is used to present a modal view controller. This provides a visual reminder to the user when the modal controller is dismissed as to which cell was tapped to invoke the modal controller.
The tap action will be invoked first, followed by the navigation action if one is attached.
object | The object to attach the selector to. This object must be contained within an NITableViewModel. |
selector | The selector that will be invoked by this action. |
Attaches a detail selector to the given object.
The method signature for the selector is:
A cell with an attached tap action will have its selectionStyle set to tableViewCellSelectionStyle
and its accessoryType set to UITableViewCellAccessoryDetailDisclosureButton
when the cell is displayed.
The selector will be performed on the action object's target when a cell with a detail selector's accessory indicator is tapped, unless that selector does not exist on the target
in which case nothing happens.
object | The object to attach the selector to. This object must be contained within an NITableViewModel. |
selector | The selector that will be invoked by this action. |
Attaches a navigation selector to the given object.
The method signature for the selector is:
A cell with an attached navigation action will have its selectionStyle set to tableViewCellSelectionStyle
and its accessoryType set to UITableViewCellAccessoryDetailDisclosureButton
, unless it also has an attached detail action, in which case its accessoryType will be set to UITableViewCellAccessoryDisclosureIndicator
when the cell is displayed.
The selector will be performed on the action object's target when a cell with a navigation selector is tapped, unless that selector does not exist on the target
in which case nothing happens.
object | The object to attach the selector to. This object must be contained within an NITableViewModel. |
selector | The selector that will be invoked by this action. |
Attaches a tap block to a class.
This method behaves similarly to attachToObject:tapBlock: except it attaches a tap action to all instances and subclassed instances of a given class.
aClass | The class to attach the action to. |
action | The tap action block. |
Attaches a detail block to a class.
This method behaves similarly to attachToObject:detailBlock: except it attaches a detail action to all instances and subclassed instances of a given class.
aClass | The class to attach the action to. |
action | The detail action block. |
Attaches a navigation block to a class.
This method behaves similarly to attachToObject:navigationBlock: except it attaches a navigation action to all instances and subclassed instances of a given class.
aClass | The class to attach the action to. |
action | The navigation action block. |
Attaches a tap selector to a class.
This method behaves similarly to attachToObject:tapBlock: except it attaches a tap action to all instances and subclassed instances of a given class.
aClass | The class to attach the action to. |
selector | The tap selector. |
Attaches a detail selector to a class.
This method behaves similarly to attachToObject:detailBlock: except it attaches a detail action to all instances and subclassed instances of a given class.
aClass | The class to attach the action to. |
selector | The tap selector. |
Attaches a navigation selector to a class.
This method behaves similarly to attachToObject:navigationBlock: except it attaches a navigation action to all instances and subclassed instances of a given class.
aClass | The class to attach the action to. |
selector | The tap selector. |
Returns whether or not the object has any actions attached to it.
Returns a mapped object from the given key class.
If the key class is a subclass of any mapped key classes, the nearest ancestor class's mapped object will be returned and keyClass will be added to the map for future accesses.
keyClass | The key class that will be used to find the mapping in map. |
map | A map of key classes to classes. May be modified if keyClass is a subclass of any existing key classes. |
Returns a block that pushes an instance of the controllerClass onto the navigation stack.
Allocates an instance of the controller class and calls the init selector.
The target property of the NIActions instance must be an instance of UIViewController with an attached navigationController.
controllerClass | The class of controller to instantiate. |