Skip to content

Commit

Permalink
Merge pull request #36 from marklarr/marklarr/multiple_cell_sections
Browse files Browse the repository at this point in the history
multiple cell sections
  • Loading branch information
0thernet committed Jun 25, 2014
2 parents f48decc + e52e1c8 commit 94758bc
Show file tree
Hide file tree
Showing 9 changed files with 488 additions and 191 deletions.
3 changes: 2 additions & 1 deletion BZGFormViewController/BZGFormCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ - (id)init
self.imageView.hidden = YES;

self.selectionStyle = UITableViewCellSelectionStyleNone;
self.validationState = BZGValidationStateNone;
self.backgroundColor = BZG_BACKGROUND_COLOR;

_validationState = BZGValidationStateNone;
}
return self;
}
Expand Down
64 changes: 61 additions & 3 deletions BZGFormViewController/BZGFormViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
@property (nonatomic, strong) UITableView *tableView;

/// The form cells used to populate the table view's form section.
@property (nonatomic, strong) NSMutableArray *formCells;
@property (nonatomic, strong) NSMutableArray *formCells __deprecated;

/// The table view section where the form should be displayed.
@property (nonatomic, assign) NSUInteger formSection;
/// The table view section where the form should be displayed. (Use
@property (nonatomic, assign) NSUInteger formSection __deprecated;

/// A property indicating whether or not the keyboard should display an input accessory view with previous, next, and done buttons.
@property (nonatomic, assign) BOOL showsKeyboardControl;
Expand Down Expand Up @@ -68,5 +68,63 @@
*/
- (BZGTextFieldCell *)firstInvalidFormCell;

/**
* Returns an array of cells in the section, ordered by row
*
* @return An array of cells in the section, ordered by row
*/
- (NSArray *)formCellsInSection:(NSInteger)section;

/**
* Appends the form cell at the end of the section
*
* @param formCell A BZGFormCell
* @param section A form section
*/
- (void)addFormCell:(BZGFormCell *)formCell atSection:(NSInteger)section;

/**
* Appends the form cells at the end of the section
*
* @param formCells An array of BZGFormCells
* @param section A form section
*/
- (void)addFormCells:(NSArray *)formCells atSection:(NSInteger)section;

/**
* Inserts the form cells into the section, starting at the specified index path
*
* @param formCells An array of BZGFormCells
* @param indexPath An index path representing the section and row for insertion
*/
- (void)insertFormCells:(NSArray *)formCells atIndexPath:(NSIndexPath *)indexPath;

/**
* Removes the form cell at the specified index path
*
* @param indexPath An index path representing the section and row for removal
*/
- (void)removeFormCellAtIndexPath:(NSIndexPath *)indexPath;

/**
* Removes all form cells in the specified section
*
* @param section A form section
*/
- (void)removeFormCellsInSection:(NSInteger)section;

/**
* Removes all form cells from all sections
*/
- (void)removeAllFormCells;

/**
* Returns an index path for the cell in the form
*
* @param cell A BZGFormCell that's in the form
* @return An index path representing the row and section of the cell in the form
*/
- (NSIndexPath *)indexPathOfCell:(BZGFormCell *)cell;


@end
Loading

0 comments on commit 94758bc

Please sign in to comment.