RETableViewManager Class Reference
| Inherits from | NSObject |
| Conforms to | UITableViewDataSource UITableViewDelegate |
| Declared in | RETableViewManager.h RETableViewManager.m |
Overview
RETableViewManager allows to manage the content of any UITableView with ease, both forms and lists. RETableViewManager is built on top of reusable cells technique and provides
APIs for mapping any object class to any custom cell subclass.
The general idea is to allow developers to use their own UITableView and UITableViewController instances (and even subclasses), providing a layer that synchronizes data with the cell appereance.
It fully implements UITableViewDelegate and UITableViewDataSource protocols so you don’t have to.
Tasks
Managing Table View and Sections
-
sectionsThe array of sections. See RETableViewSection reference for details.
property -
tableViewThe
propertyUITableViewthat needs to be managed using thisRETableViewManager.
Creating and Initializing a RETableViewManager
-
– initWithTableView:delegate:Initialize a table view manager object for a specific
UITableViewand specify the delegate object. -
– initWithTableView:Initialize a table view manager object for a specific
UITableView.
Managing the Delegate
-
delegateThe object that acts as the delegate of the receiving table view.
property
Managing Custom Cells
-
registeredClassesThe array of pairs of items / cell classes.
property -
– registerClass:forCellWithReuseIdentifier:For each custom item class that the manager will use, register a cell class.
-
– classForCellAtIndexPath:Returns cell class at specified index path.
-
– objectAtKeyedSubscript:Returns cell class at the keyed subscript.
-
– setObject:forKeyedSubscript:Sets a cell class for the keyed subscript.
Setting Style
-
styleThe object that provides styling for
propertyUITableView. See RETableViewCellStyle reference for details.
Adding sections
-
– addSection:Inserts a given section at the end of the table view.
-
– addSectionsFromArray:Adds the sections contained in another given sections array to the end of the table view.
-
– insertSection:atIndex:Inserts a given section into the table view at a given index.
-
– insertSections:atIndexes:Inserts the sections in the provided array into the table view at the specified indexes.
Removing Sections
-
– removeSection:Removes all occurrences in the table view of a given section.
-
– removeAllSectionsEmpties the table view of all its sections.
-
– removeSectionIdenticalTo:inRange:Removes all occurrences of section within the specified range in the table view.
-
– removeSectionIdenticalTo:Removes all occurrences of a given section in the sections array.
-
– removeSectionsInArray:Removes from the table view the sections in another given array.
-
– removeSectionsInRange:Removes from the table view each of the sections within a given range.
-
– removeSection:inRange:Removes all occurrences within a specified range in the table view of a given section.
-
– removeLastSectionRemoves the section with the highest-valued index in the table view.
-
– removeSectionAtIndex:Removes the section at index.
-
– removeSectionsAtIndexes:Removes the sections at the specified indexes from the table view.
Replacing Sections
-
– replaceSectionAtIndex:withSection:Replaces the section at index with
section. -
– replaceSectionsWithSectionsFromArray:Replaces the sections in the table view with all of the sections from a given array.
-
– replaceSectionsAtIndexes:withSections:Replaces the sections in the table view at specified locations specified with the sections from a given array.
-
– replaceSectionsInRange:withSectionsFromArray:range:Replaces the sections in the table view by one given range with the sections in another array specified by another range.
-
– replaceSectionsInRange:withSectionsFromArray:Replaces the sections in the table view specified by a given range with all of the sections from a given array.
Rearranging Sections
-
– exchangeSectionAtIndex:withSectionAtIndex:Exchanges the sections in the table view at given indices.
-
– sortSectionsUsingFunction:context:Sorts the sections in ascending order as defined by the comparison function compare.
-
– sortSectionsUsingSelector:Sorts the sections in ascending order, as determined by the comparison method specified by a given selector.
Properties
delegate
The object that acts as the delegate of the receiving table view.
@property (assign, readwrite, nonatomic) id<RETableViewManagerDelegate,UITableViewDelegate> delegateDiscussion
The object that acts as the delegate of the receiving table view.
Declared In
RETableViewManager.hregisteredClasses
The array of pairs of items / cell classes.
@property (strong, readwrite, nonatomic) NSMutableDictionary *registeredClassesDiscussion
The array of pairs of items / cell classes.
Declared In
RETableViewManager.hsections
The array of sections. See RETableViewSection reference for details.
@property (strong, readwrite, nonatomic) NSMutableArray *sectionsDiscussion
The array of sections. See RETableViewSection reference for details.
Declared In
RETableViewManager.hstyle
The object that provides styling for UITableView. See RETableViewCellStyle reference for details.
@property (strong, readonly, nonatomic) RETableViewCellStyle *styleDiscussion
The object that provides styling for UITableView. See RETableViewCellStyle reference for details.
Declared In
RETableViewManager.hInstance Methods
addSection:
Inserts a given section at the end of the table view.
- (void)addSection:(RETableViewSection *)sectionParameters
- section
The section to add to the end of the table view. This value must not be
nil.
Discussion
Inserts a given section at the end of the table view.
Declared In
RETableViewManager.haddSectionsFromArray:
- (void)addSectionsFromArray:(NSArray *)arrayParameters
- array
An array of sections to add to the end of the table view.
Discussion
Adds the sections contained in another given sections array to the end of the table view.
Declared In
RETableViewManager.hclassForCellAtIndexPath:
Returns cell class at specified index path.
- (Class)classForCellAtIndexPath:(NSIndexPath *)indexPathParameters
- indexPath
The index path of cell.
Discussion
Returns cell class at specified index path.
Declared In
RETableViewManager.hexchangeSectionAtIndex:withSectionAtIndex:
Exchanges the sections in the table view at given indices.
- (void)exchangeSectionAtIndex:(NSUInteger)idx1 withSectionAtIndex:(NSUInteger)idx2Parameters
- idx1
The index of the section with which to replace the section at index idx2.
- idx2
The index of the section with which to replace the section at index idx1.
Discussion
Exchanges the sections in the table view at given indices.
Declared In
RETableViewManager.hinitWithTableView:
Initialize a table view manager object for a specific UITableView.
- (id)initWithTableView:(UITableView *)tableViewParameters
- tableView
The UITableView that needs to be managed.
Return Value
The pointer to the instance, or nil if initialization failed.
Discussion
Initialize a table view manager object for a specific UITableView.
Declared In
RETableViewManager.hinitWithTableView:delegate:
Initialize a table view manager object for a specific UITableView and specify the delegate object.
- (id)initWithTableView:(UITableView *)tableView delegate:(id<RETableViewManagerDelegate,UITableViewDelegate>)delegateParameters
- tableView
The
UITableViewthat needs to be managed.
- delegate
The delegate (RETableViewManagerDelegate) object for the table view manager.
Return Value
The pointer to the instance, or nil if initialization failed.
Discussion
Initialize a table view manager object for a specific UITableView and specify the delegate object.
Declared In
RETableViewManager.hinsertSection:atIndex:
Inserts a given section into the table view at a given index.
- (void)insertSection:(RETableViewSection *)section atIndex:(NSUInteger)indexParameters
- section
The section to add to the table view. This value must not be nil.
Discussion
Inserts a given section into the table view at a given index.
Declared In
RETableViewManager.hinsertSections:atIndexes:
Inserts the sections in the provided array into the table view at the specified indexes.
- (void)insertSections:(NSArray *)sections atIndexes:(NSIndexSet *)indexesParameters
- sections
An array of sections to insert into the table view.
Discussion
Inserts the sections in the provided array into the table view at the specified indexes.
Declared In
RETableViewManager.hobjectAtKeyedSubscript:
Returns cell class at the keyed subscript.
- (id)objectAtKeyedSubscript:(id<NSCopying>)keyParameters
- key
The keyed subscript.
Return Value
The cell class the keyed subscript.
Discussion
Returns cell class at the keyed subscript.
Declared In
RETableViewManager.hregisterClass:forCellWithReuseIdentifier:
For each custom item class that the manager will use, register a cell class.
- (void)registerClass:(NSString *)objectClass forCellWithReuseIdentifier:(NSString *)identifierParameters
- objectClass
The object class to be associated with a cell class.
- identifier
The cell class identifier.
Discussion
For each custom item class that the manager will use, register a cell class.
Declared In
RETableViewManager.hremoveAllSections
Empties the table view of all its sections.
- (void)removeAllSectionsDiscussion
Empties the table view of all its sections.
Declared In
RETableViewManager.hremoveLastSection
Removes the section with the highest-valued index in the table view.
- (void)removeLastSectionDiscussion
Removes the section with the highest-valued index in the table view.
Declared In
RETableViewManager.hremoveSection:
Removes all occurrences in the table view of a given section.
- (void)removeSection:(RETableViewSection *)sectionParameters
- section
The section to remove from the table view.
Discussion
Removes all occurrences in the table view of a given section.
Declared In
RETableViewManager.hremoveSection:inRange:
Removes all occurrences within a specified range in the table view of a given section.
- (void)removeSection:(RETableViewSection *)section inRange:(NSRange)rangeParameters
- section
The section to remove from the table view.
- range
The range from which to remove section.
Discussion
Removes all occurrences within a specified range in the table view of a given section.
Declared In
RETableViewManager.hremoveSectionAtIndex:
Removes the section at index.
- (void)removeSectionAtIndex:(NSUInteger)indexParameters
- index
The index from which to remove the section in the table view. The value must not exceed the bounds of the table view sections.
Discussion
Removes the section at index.
Declared In
RETableViewManager.hremoveSectionIdenticalTo:
Removes all occurrences of a given section in the sections array.
- (void)removeSectionIdenticalTo:(RETableViewSection *)sectionParameters
- section
The section to remove from the sections array.
Discussion
Removes all occurrences of a given section in the sections array.
Declared In
RETableViewManager.hremoveSectionIdenticalTo:inRange:
Removes all occurrences of section within the specified range in the table view.
- (void)removeSectionIdenticalTo:(RETableViewSection *)section inRange:(NSRange)rangeParameters
- section
The section to remove from the table view within range.
- range
The range in the table view from which to remove section.
Discussion
Removes all occurrences of section within the specified range in the table view.
Declared In
RETableViewManager.hremoveSectionsAtIndexes:
Removes the sections at the specified indexes from the table view.
- (void)removeSectionsAtIndexes:(NSIndexSet *)indexesParameters
Discussion
Removes the sections at the specified indexes from the table view.
Declared In
RETableViewManager.hremoveSectionsInArray:
Removes from the table view the sections in another given array.
- (void)removeSectionsInArray:(NSArray *)otherArrayParameters
- otherArray
An array containing the sections to be removed from the table view.
Discussion
Removes from the table view the sections in another given array.
Declared In
RETableViewManager.hremoveSectionsInRange:
Removes from the table view each of the sections within a given range.
- (void)removeSectionsInRange:(NSRange)rangeParameters
- range
The range of the sections to remove from the table view.
Discussion
Removes from the table view each of the sections within a given range.
Declared In
RETableViewManager.hreplaceSectionAtIndex:withSection:
Replaces the section at index with section.
- (void)replaceSectionAtIndex:(NSUInteger)index withSection:(RETableViewSection *)sectionParameters
- index
The index of the section to be replaced. This value must not exceed the bounds of the table view sections.
- section
The section with which to replace the section at index
indexin the sections array. This value must not benil.
Discussion
Replaces the section at index with section.
Declared In
RETableViewManager.hreplaceSectionsAtIndexes:withSections:
Replaces the sections in the table view at specified locations specified with the sections from a given array.
- (void)replaceSectionsAtIndexes:(NSIndexSet *)indexes withSections:(NSArray *)sectionsParameters
- indexes
The indexes of the sections to be replaced.
Discussion
Replaces the sections in the table view at specified locations specified with the sections from a given array.
Declared In
RETableViewManager.hreplaceSectionsInRange:withSectionsFromArray:
Replaces the sections in the table view specified by a given range with all of the sections from a given array.
- (void)replaceSectionsInRange:(NSRange)range withSectionsFromArray:(NSArray *)otherArrayParameters
- range
The range of sections to replace in (or remove from) the table view.
Discussion
Replaces the sections in the table view specified by a given range with all of the sections from a given array.
Declared In
RETableViewManager.hreplaceSectionsInRange:withSectionsFromArray:range:
Replaces the sections in the table view by one given range with the sections in another array specified by another range.
- (void)replaceSectionsInRange:(NSRange)range withSectionsFromArray:(NSArray *)otherArray range:(NSRange)otherRangeParameters
- range
The range of sections to replace in (or remove from) the table view.
Discussion
Replaces the sections in the table view by one given range with the sections in another array specified by another range.
Declared In
RETableViewManager.hreplaceSectionsWithSectionsFromArray:
- (void)replaceSectionsWithSectionsFromArray:(NSArray *)otherArrayDeclared In
RETableViewManager.hsetObject:forKeyedSubscript:
Sets a cell class for the keyed subscript.
- (void)setObject:(id)obj forKeyedSubscript:(id<NSCopying>)keyParameters
- obj
The cell class to set for the keyed subscript.
- key
The keyed subscript.
Discussion
Sets a cell class for the keyed subscript.
Declared In
RETableViewManager.hsortSectionsUsingFunction:context:
Sorts the sections in ascending order as defined by the comparison function compare.
- (void)sortSectionsUsingFunction:(NSInteger ( *) ( id , id , void *))compare context:(void *)contextParameters
- compare
The comparison function to use to compare two sections at a time.
- context
The context argument to pass to the compare function.
Discussion
Sorts the sections in ascending order as defined by the comparison function compare.
Declared In
RETableViewManager.hsortSectionsUsingSelector:
Sorts the sections in ascending order, as determined by the comparison method specified by a given selector.
- (void)sortSectionsUsingSelector:(SEL)comparatorParameters
- comparator
A selector that specifies the comparison method to use to compare sections in the table view.
Discussion
Sorts the sections in ascending order, as determined by the comparison method specified by a given selector.
Declared In
RETableViewManager.h