Nimbus
0.9.3 - Nimbus is proudly hosted on Github
An iOS framework whose growth is bounded by O(documentation).
|
A general-purpose radio group.
This group object manages radio-style selection of objects. Only one object may be selected at a time.
Due to the general-purpose nature of this object, it can be used with UITableViews or any other view that has sets of objects being displayed. This object can insert itself into a UITableViewDelegate call chain to minimize the amount of code that needs to be written in your controller.
If you add a NIRadioGroup object to a NITableViewModel, it will show a cell that displays the current radio group selection. This cell is also tappable. Tapping this cell will push a controller onto the navigation stack that presents the radio group options for the user to select. The radio group delegate is notified immediately when a selection is made and the tapped cell is also updated to reflect the new selection.
Definition at line 44 of file NIRadioGroup.h.
Methods | |
(Class) | - cellClass |
(UITableViewCellStyle) | - cellStyle |
Selection | |
NSInteger | selectedIdentifier property |
(BOOL) | - hasSelection |
(void) | - clearSelection |
Forwarding | |
UITableViewCellSelectionStyle | tableViewCellSelectionStyle property |
NSString * | cellTitle property |
NSString * | controllerTitle property |
(NSArray *) | - allObjects |
Mapping Objects | |
(id) | - mapObject:toIdentifier: |
Object State | |
(BOOL) | - isObjectInRadioGroup: |
(BOOL) | - isObjectSelected: |
(NSInteger) | - identifierForObject: |
- (NSInteger) selectedIdentifier [read, write, assign] |
The currently selected identifier if one is selected, otherwise returns NSIntegerMin.
Definition at line 58 of file NIRadioGroup.h.
- NIRadioGroup: [read, write, assign] |
The cell selection style that will be applied to the cell when it is displayed using delegate forwarding.
By default this is UITableViewCellSelectionStyleBlue.
Definition at line 69 of file NIRadioGroup.h.
- NIRadioGroup: [read, write, copy] |
The title of the cell that is displayed for a radio group in a UITableView.
Definition at line 75 of file NIRadioGroup.h.
- NIRadioGroup: [read, write, copy] |
The title of the controller that shows the sub radio group selection.
Definition at line 76 of file NIRadioGroup.h.
- (id) mapObject: | (id) | object | |
toIdentifier: | (NSInteger) | identifier | |
Maps the given object to the given identifier.
The identifier will be used in all subsequent operations and is a means of abstracting away the objects. The identifier range does not have to be sequential. The only reserved value is NSIntegerMin, which is used to signify that no selection exists.
You can NOT map the same object to multiple identifiers. Attempts to do so fill fire a debug assertion and will not map the new object in the radio group.
object | The object to map to the identifier. |
identifier | The identifier that will represent the object. |
Definition at line 171 of file NIRadioGroup.m.
- NIRadioGroup: |
Whether or not a selection has been made.
- (void) clearSelection |
Removes the selection from this cell group.
Definition at line 212 of file NIRadioGroup.m.
- (BOOL) isObjectInRadioGroup: | (id) | object |
Returns YES if the given object is in this radio group.
Definition at line 218 of file NIRadioGroup.m.
- (BOOL) isObjectSelected: | (id) | object |
Returns YES if the given object is selected.
This method should only be called after verifying that the object is contained within the radio group with isObjectInRadioGroup:.
Definition at line 227 of file NIRadioGroup.m.
- (NSInteger) identifierForObject: | (id) | object |
Returns the mapped identifier for this object.
This method should only be called after verifying that the object is contained within the radio group with isObjectInRadioGroup:.
Definition at line 245 of file NIRadioGroup.m.
- (NSArray *) allObjects |
An array of mapped objects in this radio group, ordered in the same order they were mapped.
This is used primarily by NIRadioGroupController to display the radio group options.
Definition at line 257 of file NIRadioGroup.m.
- (Class) cellClass | [required, inherited] |
The class of cell to be created when this object is passed to the cell factory.
- (UITableViewCellStyle) cellStyle | [optional, inherited] |
The style of UITableViewCell to be used when initializing the cell for the first time.