Inherits from UITableViewCell
Conforms to SCTableViewControllerDelegate
SCViewControllerDelegate
Declared in SCTableViewCell.h

Overview

This class functions as a cell for SCTableViewSection. SCTableViewCell is extensively subclassed to create cells with special controls such as UITextField and UISlider.

SCTableViewCell provides the user with the infrastructure to access the cell’s value using the Bound Object method. This works by binding the cell to an object, called the bound object, and to a property of this object, called the bound property. The cell initializes its value from the value of the bound property, and when its values changes, it sets the property back automatically.

Please note that even though a cell value is not applicable to SCTableViewCell itself, SCTableViewCell still provides the bound object functionality as a framework to all its subclasses to use.

Tasks

Creation and Initialization

Configuration

  •   ownerTableViewModel

    The owner table view model of the cell.

    property
  •   ownerSection

    The owner section of the cell.

    property
  •   cellActions

    The set of cell action blocks.

    property
  •   boundObject

    The cell’s bound object (see class overview).

    property
  •   boundObjectStore

    The data store of the cell’s bound object.

    property
  •   boundPropertyName

    The cell’s bound property name (see class overview).

    property
  •   height

    The height of the cell.

    property
  •   editable

    The editable state of the cell. Default: FALSE.

    property
  •   movable

    The movable state of the cell. Default: FALSE.

    property
  •   selectable

    Determines if the cell can be selected. Default: TRUE.

    property
  •   enabled

    Set to FALSE to disable the cell’s functionality. Usefull in situations where the cell should only be enabled in ‘Editing Mode’ for example. Default: TRUE.

    property
  •   badgeView

    The cell’s badge view. When assigned a text value, the badgeView displays a badge similar to the badge displayed by the iPhone’s mail application for its mail folders.

    property
  •   detailCellsImageViews

    Set this property to an array of UIImageView objects to be set to each of the cell’s detail cells.

    property
  •   autoDeselect

    If property is TRUE, the cell gets automatically deselected whenever the user selects it. Default: FALSE.

    property
  •   autoResignFirstResponder

    If property is TRUE, the cell automatically dismisses the keyboard (if applicable) when another cell is selected or when the value of another cell is changed. Default: TRUE.

    property
  •   cellEditingStyle

    The cell’s editing style.

    property
  •   valueRequired

    Determines if the cell’s value is required. If TRUE, valueIsValid will only return true if the cells value is not empty. Default: FALSE.

    property
  •   autoValidateValue

    Determines whether to automatically validate the cell’s value. Where applicable, each subclass provides its own rules for validating the cell’s value. If the user chooses to provide custom validation using either the cell’s actions, or the model’s SCTableViewModelDelegate, they should set this property to FALSE. Default: TRUE.

    property
  •   valueIsValid

    This property is TRUE if the cell’s value is valid. The validity of the cell’s value depend on the valueRequired and the validateValue properties. If valueRequired is TRUE, valueIsValid is TRUE only if the cell contains a value. If validateValue is TRUE, valueIsValid depends on each subclass to provide validation of the cell’s value. For validation, the user can also provide custom validation using either the cell’s actions, or the model’s SCTableViewModelDelegate.

    property
  •   detailViewControllerOptions

    Options for the generated detail view controller (only applicable to subclasses with a detail view controller).

    property
  •   themeStyle

    The theme style used to style the cell. A nil ‘themeStyle’ value will use the style having the same name of the cell’s class name. If no style with the class name is found, the name of the super class will be used, and so on. Default: nil.

    property

Managing Cell Value

  •   commitChangesLive

    Set this property to TRUE for the cell to commit its value as soon as it is changed. If this value is FALSE, the user must explicitly call commitChanges for the cell to commit its value changes. Default: TRUE.

    property
  •   needsCommit

    This propery is TRUE if the cell value has changed and needs to be committed. If commitChangesLive is TRUE, this property always remains FALSE.

    property
  • – commitChanges

    Commits any changes to the cell’s value either to the bound object or the bound key where applicable (see class overview).

  • – reloadBoundValue

    Reload’s the cell’s bound value in case the associated boundProperty value has changed by means other than the cell itself (e.g. external custom code).

Misc. Properties

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

Properties

autoDeselect

If property is TRUE, the cell gets automatically deselected whenever the user selects it. Default: FALSE.

@property (nonatomic, readwrite) BOOL autoDeselect

Declared In

SCTableViewCell.h

autoResignFirstResponder

If property is TRUE, the cell automatically dismisses the keyboard (if applicable) when another cell is selected or when the value of another cell is changed. Default: TRUE.

@property (nonatomic, readwrite) BOOL autoResignFirstResponder

Declared In

SCTableViewCell.h

autoValidateValue

Determines whether to automatically validate the cell’s value. Where applicable, each subclass provides its own rules for validating the cell’s value. If the user chooses to provide custom validation using either the cell’s actions, or the model’s SCTableViewModelDelegate, they should set this property to FALSE. Default: TRUE.

@property (nonatomic, readwrite) BOOL autoValidateValue

Declared In

SCTableViewCell.h

badgeView

The cell’s badge view. When assigned a text value, the badgeView displays a badge similar to the badge displayed by the iPhone’s mail application for its mail folders.

@property (nonatomic, readonly) SCBadgeView *badgeView

Declared In

SCTableViewCell.h

beingReused

Property used internally by framework to determine if cell is being dequed and reused.

@property (nonatomic, readwrite) BOOL beingReused

Declared In

SCTableViewCell.h

boundObject

The cell’s bound object (see class overview).

@property (nonatomic, strong) NSObject *boundObject

Declared In

SCTableViewCell.h

boundObjectStore

The data store of the cell’s bound object.

@property (nonatomic, strong) SCDataStore *boundObjectStore

Declared In

SCTableViewCell.h

boundPropertyDataType

Property should only be used internally by framework.

@property (nonatomic, readwrite) SCDataType boundPropertyDataType

Declared In

SCTableViewCell.h

boundPropertyName

The cell’s bound property name (see class overview).

@property (nonatomic, copy) NSString *boundPropertyName

Declared In

SCTableViewCell.h

boundValue

This property represents the bound value of the cell.

@property (nonatomic, strong) NSObject *boundValue

Declared In

SCTableViewCell.h

cellActions

The set of cell action blocks.

@property (nonatomic, readonly) SCCellActions *cellActions

Declared In

SCTableViewCell.h

cellEditingStyle

The cell’s editing style.

@property (nonatomic, readwrite) UITableViewCellEditingStyle cellEditingStyle

Declared In

SCTableViewCell.h

commitChangesLive

Set this property to TRUE for the cell to commit its value as soon as it is changed. If this value is FALSE, the user must explicitly call commitChanges for the cell to commit its value changes. Default: TRUE.

@property (nonatomic, readwrite) BOOL commitChangesLive

Declared In

SCTableViewCell.h

configured

Property used internally.

@property (nonatomic, readwrite) BOOL configured

Declared In

SCTableViewCell.h

customCell

Property used internally by framework to determine if cell is a custom cell.

@property (nonatomic, readwrite) BOOL customCell

Declared In

SCTableViewCell.h

detailCellsImageViews

Set this property to an array of UIImageView objects to be set to each of the cell’s detail cells.

@property (nonatomic, strong) NSArray *detailCellsImageViews

Discussion

Note: Only applicable to cells with detail views.

Declared In

SCTableViewCell.h

detailViewControllerOptions

Options for the generated detail view controller (only applicable to subclasses with a detail view controller).

@property (nonatomic, readonly) SCDetailViewControllerOptions *detailViewControllerOptions

Declared In

SCTableViewCell.h

editable

The editable state of the cell. Default: FALSE.

@property (nonatomic, readwrite) BOOL editable

Declared In

SCTableViewCell.h

enabled

Set to FALSE to disable the cell’s functionality. Usefull in situations where the cell should only be enabled in ‘Editing Mode’ for example. Default: TRUE.

@property (nonatomic, readwrite) BOOL enabled

Declared In

SCTableViewCell.h

height

The height of the cell.

@property (nonatomic, readwrite) CGFloat height

Declared In

SCTableViewCell.h

isSpecialCell

Is TRUE if the cell is a special cell. Special cells are cells like addNewItemCell or placeholderCell and typically exist within an SCArrayOfItemsSection.

@property (nonatomic, readonly) BOOL isSpecialCell

Declared In

SCTableViewCell.h

movable

The movable state of the cell. Default: FALSE.

@property (nonatomic, readwrite) BOOL movable

Declared In

SCTableViewCell.h

needsCommit

This propery is TRUE if the cell value has changed and needs to be committed. If commitChangesLive is TRUE, this property always remains FALSE.

@property (nonatomic, readonly) BOOL needsCommit

Declared In

SCTableViewCell.h

ownerSection

The owner section of the cell.

@property (nonatomic, unsafe_unretained) SCTableViewSection *ownerSection

Discussion

Warning: This property gets set automatically by the framework, you should never set this property manually

Declared In

SCTableViewCell.h

ownerTableViewModel

The owner table view model of the cell.

@property (nonatomic, unsafe_unretained) SCTableViewModel *ownerTableViewModel

Discussion

Warning: This property gets set automatically by the framework, you should never set this property manually

Declared In

SCTableViewCell.h

reuseId

Property used internally by framework to change reuseIdentifier after the cell has been created.

@property (nonatomic, copy) NSString *reuseId

Declared In

SCTableViewCell.h

selectable

Determines if the cell can be selected. Default: TRUE.

@property (nonatomic, readwrite) BOOL selectable

Declared In

SCTableViewCell.h

themeStyle

The theme style used to style the cell. A nil ‘themeStyle’ value will use the style having the same name of the cell’s class name. If no style with the class name is found, the name of the super class will be used, and so on. Default: nil.

@property (nonatomic, copy) NSString *themeStyle

Declared In

SCTableViewCell.h

valueIsValid

This property is TRUE if the cell’s value is valid. The validity of the cell’s value depend on the valueRequired and the validateValue properties. If valueRequired is TRUE, valueIsValid is TRUE only if the cell contains a value. If validateValue is TRUE, valueIsValid depends on each subclass to provide validation of the cell’s value. For validation, the user can also provide custom validation using either the cell’s actions, or the model’s SCTableViewModelDelegate.

@property (nonatomic, readonly) BOOL valueIsValid

Declared In

SCTableViewCell.h

valueRequired

Determines if the cell’s value is required. If TRUE, valueIsValid will only return true if the cells value is not empty. Default: FALSE.

@property (nonatomic, readwrite) BOOL valueRequired

Declared In

SCTableViewCell.h

Class Methods

cell

Allocates and returns an initialized SCTableViewCell.

+ (id)cell

Declared In

SCTableViewCell.h

cellWithStyle:

Allocates and returns an initialized SCTableViewCell given the cell’s style.

+ (id)cellWithStyle:(UITableViewCellStyle)style

Declared In

SCTableViewCell.h

cellWithText:

Allocates and returns an initialized SCTableViewCell given cell text.

+ (id)cellWithText:(NSString *)cellText

Parameters

cellText

The text that will appear in the cell’s textLabel.

Declared In

SCTableViewCell.h

cellWithText:boundObject:boundPropertyName:

Allocates and returns an initialized SCTableViewCell given cell text, bound object, and a bound property name.

+ (id)cellWithText:(NSString *)cellText boundObject:(NSObject *)object boundPropertyName:(NSString *)propertyName

Parameters

cellText

The text that will appear in the cell’s textLabel.

object

The cell’s bound object (see class overview).

propertyName

The cell’s bound property name (see class overview).

Declared In

SCTableViewCell.h

cellWithText:textAlignment:

Allocates and returns an initialized SCTableViewCell given cell text and its alignment.

+ (id)cellWithText:(NSString *)cellText textAlignment:(UITextAlignment)textAlignment

Parameters

cellText

The text that will appear in the cell’s textLabel.

textAlignment

The alignment setting for the cell’s text.

Declared In

SCTableViewCell.h

Instance Methods

buildDetailModel:

Subclasses should override this method to build a detail model for the detail view controller.

- (void)buildDetailModel:(SCTableViewModel *)detailModel

Declared In

SCTableViewCell.h

cellValueChanged

Method gets called internally whenever the cell value changes.

- (void)cellValueChanged

Discussion

This method should only be used when subclassing ‘SCTableViewCell’. If what you want is to get notified when a cell value changes, consider using either cell’s actions or SCTableViewModelDelegate methods.

Declared In

SCTableViewCell.h

commitChanges

Commits any changes to the cell’s value either to the bound object or the bound key where applicable (see class overview).

- (void)commitChanges

Declared In

SCTableViewCell.h

commitDetailModelChanges:

Subclasses should override this method to commit the detail model changes.

- (void)commitDetailModelChanges:(SCTableViewModel *)detailModel

Declared In

SCTableViewCell.h

defaultDetailViewControllerNavigationBarType

Subclasses should override this method to change the returned default detail view controller navigation bar type.

- (SCNavigationBarType)defaultDetailViewControllerNavigationBarType

Declared In

SCTableViewCell.h

didDeselectCell

Method gets called internally whenever the cell is deselected. 
- (void)didDeselectCell

Declared In

SCTableViewCell.h

didSelectCell

Method gets called internally whenever the cell gets selected.

- (void)didSelectCell

Discussion

This method should only be used when subclassing ‘SCTableViewCell’. If what you want is to get notified when a cell gets selected, consider using either the cell’s actions or SCTableViewModelDelegate methods.

Declared In

SCTableViewCell.h

getDetailViewControllerForCell:forRowAtIndexPath:allowUITableViewControllerSubclass:

Subclasses should call this method to get a detail view controller.

- (UIViewController *)getDetailViewControllerForCell:(SCTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath allowUITableViewControllerSubclass:(BOOL)allowUITableViewController

Declared In

SCTableViewCell.h

getValueIsValid

Method should be overridden by subclasses to provide subclass specific validation of the cell’s value.

- (BOOL)getValueIsValid

Discussion

If what you want is to be able to provide custom cell value validation, consider using either the cell’s actions or SCTableViewModelDelegate methods.

Declared In

SCTableViewCell.h

handleDetailViewControllerDidDismiss:cancelButtonTapped:doneButtonTapped:

Subclasses should override this method to handle their detail view controller didDismiss. Superclass method must be called.

- (void)handleDetailViewControllerDidDismiss:(UIViewController *)detailViewController cancelButtonTapped:(BOOL)cancelTapped doneButtonTapped:(BOOL)doneTapped

Declared In

SCTableViewCell.h

handleDetailViewControllerDidPresent:

Subclasses should override this method to handle their detail view controller didPresent. Superclass method must be called.

- (void)handleDetailViewControllerDidPresent:(UIViewController *)detailViewController

Declared In

SCTableViewCell.h

handleDetailViewControllerShouldDismiss:cancelButtonTapped:doneButtonTapped:

Subclasses should override this method to handle their detail view controller shouldDismiss. Superclass method must be called.

- (BOOL)handleDetailViewControllerShouldDismiss:(UIViewController *)detailViewController cancelButtonTapped:(BOOL)cancelTapped doneButtonTapped:(BOOL)doneTapped

Declared In

SCTableViewCell.h

handleDetailViewControllerWillDismiss:cancelButtonTapped:doneButtonTapped:

Subclasses should override this method to handle their detail view controller willDismiss. Superclass method must be called.

- (void)handleDetailViewControllerWillDismiss:(UIViewController *)detailViewController cancelButtonTapped:(BOOL)cancelTapped doneButtonTapped:(BOOL)doneTapped

Declared In

SCTableViewCell.h

handleDetailViewControllerWillPresent:

Subclasses should override this method to handle their detail view controller willPresent. Superclass method must be called.

- (void)handleDetailViewControllerWillPresent:(UIViewController *)detailViewController

Declared In

SCTableViewCell.h

initWithText:

Returns an initialized SCTableViewCell given cell text.

- (id)initWithText:(NSString *)cellText

Parameters

cellText

The text that will appear in the cell’s textLabel.

Declared In

SCTableViewCell.h

initWithText:boundObject:boundPropertyName:

Returns an initialized SCTableViewCell given cell text, bound object, and a bound property name.

- (id)initWithText:(NSString *)cellText boundObject:(NSObject *)object boundPropertyName:(NSString *)propertyName

Parameters

cellText

The text that will appear in the cell’s textLabel.

object

The cell’s bound object (see class overview).

propertyName

The cell’s bound property name (see class overview).

Declared In

SCTableViewCell.h

initWithText:textAlignment:

Returns an initialized SCTableViewCell given cell text and its alignment.

- (id)initWithText:(NSString *)cellText textAlignment:(UITextAlignment)textAlignment

Parameters

cellText

The text that will appear in the cell’s textLabel.

textAlignment

The alignment setting for the cell’s text.

Declared In

SCTableViewCell.h

markCellAsSpecial

Marks the cell as a special cell.

- (void)markCellAsSpecial

Declared In

SCTableViewCell.h

modelForViewController:

Method called internally.

- (SCTableViewModel *)modelForViewController:(UIViewController *)viewController

Declared In

SCTableViewCell.h

performInitialization

Method should be overridden by subclasses to perform any required initialization.

- (void)performInitialization

Discussion

Warning: Subclasses must call [super performInitialization] from within the method’s implementation.

Declared In

SCTableViewCell.h

prepareCellForDetailViewAppearing

Method is called internally by the framework before a detail view appears.

- (void)prepareCellForDetailViewAppearing

Declared In

SCTableViewCell.h

prepareCellForDetailViewDisappearing

Method is called internally by the framework before a detail view disappears.

- (void)prepareCellForDetailViewDisappearing

Declared In

SCTableViewCell.h

presentDetailViewController:forCell:forRowAtIndexPath:withPresentationMode:

Subclasses should call this method to present their detail view controller.

- (void)presentDetailViewController:(UIViewController *)detailViewController forCell:(SCTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath withPresentationMode:(SCPresentationMode)mode

Declared In

SCTableViewCell.h

reloadBoundValue

Reload’s the cell’s bound value in case the associated boundProperty value has changed by means other than the cell itself (e.g. external custom code).

- (void)reloadBoundValue

Declared In

SCTableViewCell.h

setAttributesTo:

Method should be overridden by subclasses to support property attributes.

- (void)setAttributesTo:(SCPropertyAttributes *)attributes

Discussion

The method should be able to set the subclass' specific attributes to its corresponding SCPropertyAttributes subclass.

Declared In

SCTableViewCell.h

setDetailViewControllerOptions:

Method called internally.

- (void)setDetailViewControllerOptions:(SCDetailViewControllerOptions *)options

Declared In

SCTableViewCell.h

setIsCustomBoundProperty:

Method called internally.

- (void)setIsCustomBoundProperty:(BOOL)custom

Declared In

SCTableViewCell.h

setNeedsCommit:

Method called internally.

- (void)setNeedsCommit:(BOOL)needsCommit

Declared In

SCTableViewCell.h

willDeselectCell

Method gets called internally whenever the cell is about to be deselected. 
- (void)willDeselectCell

Declared In

SCTableViewCell.h

willDisplay

Method gets called internally whenever the cell is about to be displayed.

- (void)willDisplay

Discussion

This method should only be used when subclassing ‘SCTableViewCell’. If what you want is to get notified when a cell is about to be displayed, consider using either the cell’s actions or SCTableViewModelDelegate methods.

Declared In

SCTableViewCell.h