SCArrayOfItemsModel

@interface SCArrayOfItemsModel
    : SCTableViewModel <SCTableViewControllerDelegate, UISearchBarDelegate,
                        UISearchResultsUpdating> {
  SCArrayOfItemsSection *tempSection;
  NSArray *filteredArray;
  SCDataStore *dataStore;
  SCDataFetchOptions *dataFetchOptions;
  BOOL _loadingContents;
  BOOL sectionsInSync;
  NSMutableArray *items;
  BOOL autoFetchItems;
  BOOL itemsInSync;
  UITableViewCellAccessoryType itemsAccessoryType;
  BOOL allowAddingItems;
  BOOL allowDeletingItems;
  BOOL allowMovingItems;
  BOOL allowEditDetailView;
  BOOL allowRowSelection;
  BOOL autoSelectNewItemCell;
  SCDetailViewControllerOptions *detailViewControllerOptions;
  SCDetailViewControllerOptions *newItemDetailViewControllerOptions;
  UISearchBar *searchBar;
}

This class subclasses SCTableViewModel to represent an array of any kind of items and will automatically generate its cells from these items. ‘SCArrayOfItemsModel will automatically generate a set of SCArrayOfItemsSection(s) if the sectionHeaderTitleForItem modelAction is implemented, otherwise it will only generate a single SCArrayOfItemsSection.

Warning

This is an abstract base class, you should never make any direct instances of it.

See

SCArrayOfStringsModel, SCArrayOfObjectsModel, SCArrayOfStringsSection, SCArrayOfObjectsSection.

Creation and Initialization

  • Returns an initialized ‘SCArrayOfItemsModel given a UITableView and a data store.

    Declaration

    Objective-C

    - (instancetype)initWithTableView:(UITableView *)tableView
                            dataStore:(SCDataStore *)store;

    Parameters

    tableView

    The UITableView to be bound to the model.

    store

    The data store containing the model’s items.

Configuration

Manual Event Control

  • User can call this method to dispatch an AddNewItem event, the same event dispached when the end-user taps addButtonItem.

    Declaration

    Objective-C

    - (void)dispatchEventAddNewItem;
  • User can call this method to dispatch a SelectRow event, the same event dispached when the end-user selects a cell.

    Declaration

    Objective-C

    - (void)dispatchEventSelectRowAtIndexPath:(NSIndexPath *)indexPath;
  • User can call this method to dispatch a RemoveRow event, the same event dispached when the end-user taps the delete button on a cell.

    Declaration

    Objective-C

    - (void)dispatchEventRemoveRowAtIndexPath:(NSIndexPath *)indexPath;

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