SCTableViewSection

@interface SCTableViewSection : NSObject {
  SCTableViewModel *_ownerTableViewModel;
  NSObject *boundObject;
  SCDataStore *boundObjectStore;
  NSString *boundPropertyName;
  BOOL commitChangesLive;
  BOOL commitCellChangesLive;
  NSString *headerTitle;
  CGFloat headerHeight;
  UIView *headerView;
  NSString *footerTitle;
  CGFloat footerHeight;
  UIView *footerView;
  SCSectionActions *sectionActions;
  NSMutableArray *cells;
  SCCellActions *cellActions;
  NSArray *cellsImageViews;
  SCExpandCollapseCell *expandCollapseCell;
  SCDetailViewControllerOptions *detailViewControllerOptions;
  SCDetailViewControllerOptions *newItemDetailViewControllerOptions;
  NSString *themeStyle;
  NSString *firstCellThemeStyle;
  NSString *evenCellsThemeStyle;
  NSString *oddCellsThemeStyle;
  NSString *lastCellThemeStyle;
}

This class functions as a section for SCTableViewModel. Every ‘SCTableViewSection’ can contain any number of SCTableViewCell(s).

Creation and Initialization

  • Allocates and returns an initialized SCTableViewSection.

    Declaration

    Objective-C

    + (instancetype)section;
  • Allocates and returns an initialized SCTableViewSection given a header title. *

    • - parameter: sectionHeaderTitle A header title for the section.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle;
  • Allocates and returns an initialized SCTableViewSection given a header and a footer title. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: sectionFooterTitle A footer title for the section.

    Declaration

    Objective-C

    + (instancetype)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
                               footerTitle:(NSString *)sectionFooterTitle;
  • Returns an initialized SCTableViewSection given a header title. *

    • - parameter: sectionHeaderTitle A header title for the section.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle;
  • Returns an initialized SCTableViewSection given a header and a footer title. *

    • - parameter: sectionHeaderTitle A header title for the section.
    • - parameter: sectionFooterTitle A footer title for the section.

    Declaration

    Objective-C

    - (instancetype)initWithHeaderTitle:(NSString *)sectionHeaderTitle
                            footerTitle:(NSString *)sectionFooterTitle;

Configuration

Configuring Special Cells

  • When set to a valid SCExpandCollapseCell, the cell will control if the section’s content is expanded or collapsed. *

    • - note: Setting this property automatically adds expandCollapseCell to the section at index 0, making it the first cell.

    Declaration

    Objective-C

    @property (nonatomic, strong) SCExpandCollapseCell *expandCollapseCell;

Configuring Theme Styles

Managing Cells

  • The number of cells in the section.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSUInteger cellCount;
  • Adds a new cell to the section.

    • - parameter: cell Must be a valid non nil SCTableViewCell.

    Declaration

    Objective-C

    - (void)addCell:(SCTableViewCell *)cell;
  • Inserts a new cell into the section at the specified index.

    • - parameter: cell Must be a valid non nil SCTableViewCell.
    • - parameter: index Must be less than the total number of cells.

    Declaration

    Objective-C

    - (void)insertCell:(SCTableViewCell *)cell atIndex:(NSUInteger)index;
  • Returns the cell at the specified index.

    • - parameter: index Must be less than the total number of cells.

    Declaration

    Objective-C

    - (SCTableViewCell *)cellAtIndex:(NSUInteger)index;
  • Removes the cell at the specified index.

    • - parameter: index Must be less than the total number of cells.

    Declaration

    Objective-C

    - (void)removeCellAtIndex:(NSUInteger)index;
  • Removes the cell identical to the given cell.

    • - parameter: cell That cell to be matched against.

    Declaration

    Objective-C

    - (void)removeCellIdenticalTo:(SCTableViewCell *)cell;
  • Removes all cells in section.

    Declaration

    Objective-C

    - (void)removeAllCells;
  • Returns the index of the specified cell.

    • - parameter: cell Must be a valid non nil SCTableViewCell.
    • - returns: If cell is not found, method returns NSNotFound.

    Declaration

    Objective-C

    - (NSUInteger)indexForCell:(SCTableViewCell *)cell;

Managing Cell Values

  • This property is TRUE if all the section cells’ values are valid, otherwise it’s FALSE.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL valuesAreValid;
  • This property is TRUE if any of the section’s cells need to be commited, otherwise it’s FALSE.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL needsCommit;
  • Set this property to TRUE for the section cells to commit their values as soon as they are changed. If this value is FALSE, the user must explicitly call commitCellChanges for the cells to commit their value changes. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL commitCellChangesLive;
  • Commits value changes for all cells in section. This method needs to be called only if the commitCellChangesLive property is FALSE.

    Declaration

    Objective-C

    - (void)commitCellChanges;
  • Overrides optimization and sets all cells as needing to be committed.

    Declaration

    Objective-C

    - (void)invalidateCellCommits;
  • Reload’s the section’s bound values in case the associated bound objects or keys valuea has changed by means other than the cells themselves (e.g. external custom code).

    Declaration

    Objective-C

    - (void)reloadBoundValues;

Internal Properties & Methods (should only be used by the framework or when subclassing)