SCTableViewCell
@interface SCTableViewCell : UITableViewCell <SCViewControllerDelegate,
SCTableViewControllerDelegate> {
NSString *reuseId;
BOOL configured;
SCTableViewModel *activeDetailModel;
SCTableViewModel *ownerTableViewModel;
SCTableViewSection *ownerSection;
id ownerViewControllerDelegate;
SCDataType boundPropertyDataType;
BOOL _isCustomBoundProperty;
CGFloat _height;
BOOL editable;
BOOL movable;
BOOL selectable;
BOOL enabled;
BOOL autoDeselect;
BOOL autoResignFirstResponder;
UITableViewCellEditingStyle cellEditingStyle;
SCBadgeView *badgeView;
BOOL leadingSwipePerformsFirstActionWithFullSwipe;
BOOL trailingSwipePerformsFirstActionWithFullSwipe;
NSArray *detailCellsImageViews;
BOOL valueRequired;
BOOL autoValidateValue;
BOOL commitChangesLive;
BOOL needsCommit;
BOOL beingReused;
BOOL customCell;
BOOL isSpecialCell;
SCDetailViewControllerOptions *detailViewControllerOptions;
NSString *themeStyle;
}
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.
-
Undocumented
Declaration
Objective-C
NSString *reuseId
-
Undocumented
Declaration
Objective-C
BOOL configured
-
Unavailable
Undocumented
Declaration
Objective-C
__weak SCTableViewModel *activeDetailModel
-
Unavailable
Undocumented
Declaration
Objective-C
__weak SCTableViewModel *ownerTableViewModel
-
Unavailable
Undocumented
Declaration
Objective-C
__weak SCTableViewSection *ownerSection
-
Unavailable
Undocumented
Declaration
Objective-C
__weak id ownerViewControllerDelegate
-
Undocumented
Declaration
Objective-C
SCDataType boundPropertyDataType
-
Undocumented
Declaration
Objective-C
BOOL _isCustomBoundProperty
-
Undocumented
Declaration
Objective-C
CGFloat _height
-
Undocumented
Declaration
Objective-C
BOOL editable
-
Undocumented
Declaration
Objective-C
BOOL movable
-
Undocumented
Declaration
Objective-C
BOOL selectable
-
Undocumented
Declaration
Objective-C
BOOL enabled
-
Undocumented
Declaration
Objective-C
BOOL autoDeselect
-
Undocumented
Declaration
Objective-C
BOOL autoResignFirstResponder
-
Undocumented
Declaration
Objective-C
UITableViewCellEditingStyle cellEditingStyle
-
Undocumented
Declaration
Objective-C
SCBadgeView *badgeView
-
Undocumented
Declaration
Objective-C
BOOL leadingSwipePerformsFirstActionWithFullSwipe
-
Undocumented
Declaration
Objective-C
BOOL trailingSwipePerformsFirstActionWithFullSwipe
-
Undocumented
Declaration
Objective-C
NSArray *detailCellsImageViews
-
Undocumented
Declaration
Objective-C
BOOL valueRequired
-
Undocumented
Declaration
Objective-C
BOOL autoValidateValue
-
Undocumented
Declaration
Objective-C
BOOL commitChangesLive
-
Undocumented
Declaration
Objective-C
BOOL needsCommit
-
Undocumented
Declaration
Objective-C
BOOL beingReused
-
Undocumented
Declaration
Objective-C
BOOL customCell
-
Undocumented
Declaration
Objective-C
BOOL isSpecialCell
-
Undocumented
Declaration
Objective-C
SCDetailViewControllerOptions *detailViewControllerOptions
-
Undocumented
Declaration
Objective-C
NSString *themeStyle
-
Allocates and returns an initialized SCTableViewCell.
Declaration
Objective-C
+ (instancetype)cell;
-
Allocates and returns an initialized SCTableViewCell given the cell’s style.
Declaration
Objective-C
+ (instancetype)cellWithStyle:(UITableViewCellStyle)style;
-
Allocates and returns an initialized SCTableViewCell given cell text.
- - parameter: cellText The text that will appear in the cell’s textLabel.
Declaration
Objective-C
+ (instancetype)cellWithText:(NSString *)cellText;
-
Allocates and returns an initialized SCTableViewCell given cell text and its alignment.
- - parameter: cellText The text that will appear in the cell’s textLabel.
- - parameter: textAlignment The alignment setting for the cell’s text.
Declaration
Objective-C
+ (instancetype)cellWithText:(NSString *)cellText textAlignment:(NSTextAlignment)textAlignment;
-
Allocates and returns an initialized SCTableViewCell given cell text, bound object, and a bound property name.
- - parameter: cellText The text that will appear in the cell’s textLabel.
- - parameter: object The cell’s bound object (see class overview).
- - parameter: propertyName The cell’s bound property name (see class overview).
Declaration
Objective-C
+ (instancetype)cellWithText:(NSString *)cellText boundObject:(NSObject *)object boundPropertyName:(NSString *)propertyName;
-
Returns an initialized SCTableViewCell given cell text.
- - parameter: cellText The text that will appear in the cell’s textLabel.
Declaration
Objective-C
- (instancetype)initWithText:(NSString *)cellText;
-
Returns an initialized SCTableViewCell given cell text and its alignment.
- - parameter: cellText The text that will appear in the cell’s textLabel.
- - parameter: textAlignment The alignment setting for the cell’s text.
Declaration
Objective-C
- (instancetype)initWithText:(NSString *)cellText textAlignment:(NSTextAlignment)textAlignment;
-
Returns an initialized SCTableViewCell given cell text, bound object, and a bound property name.
- - parameter: cellText The text that will appear in the cell’s textLabel.
- - parameter: object The cell’s bound object (see class overview).
- - parameter: propertyName The cell’s bound property name (see class overview).
Declaration
Objective-C
- (instancetype)initWithText:(NSString *)cellText boundObject:(NSObject *)object boundPropertyName:(NSString *)propertyName;
-
The owner table view model of the cell. *
- - warning: This property gets set automatically by the framework, you should never set this property manually
Declaration
Objective-C
@property (nonatomic, weak) SCTableViewModel *ownerTableViewModel;
-
The owner section of the cell. *
- - warning: This property gets set automatically by the framework, you should never set this property manually
Declaration
Objective-C
@property (nonatomic, weak) SCTableViewSection *ownerSection;
-
The set of cell action blocks.
Declaration
Objective-C
@property (nonatomic, readonly) SCCellActions *cellActions;
-
The cell’s bound object (see class overview).
Declaration
Objective-C
@property (nonatomic, strong) NSObject *boundObject;
-
The data store of the cell’s bound object.
Declaration
Objective-C
@property (nonatomic, strong) SCDataStore *boundObjectStore;
-
The cell’s bound property name (see class overview).
Declaration
Objective-C
@property (nonatomic, copy) NSString *boundPropertyName;
-
The height of the cell. Default: UITableViewAutomaticDimension.
Declaration
Objective-C
@property (nonatomic) CGFloat height;
-
The editable state of the cell. Default: FALSE.
Declaration
Objective-C
@property (nonatomic) BOOL editable;
-
The movable state of the cell. Default: FALSE.
Declaration
Objective-C
@property (nonatomic) BOOL movable;
-
Determines if the cell can be selected. Default: TRUE.
Declaration
Objective-C
@property (nonatomic) BOOL selectable;
-
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.
Declaration
Objective-C
@property (nonatomic) BOOL enabled;
-
The color to be used for text elements when the cell’s enabled property is set to FALSE. Default: black color.
Declaration
Objective-C
@property (nonatomic, strong) UIColor *disabledTextColor;
-
The cell style.
Declaration
Objective-C
@property (nonatomic, readonly) UITableViewCellStyle cellStyle;
-
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.
Declaration
Objective-C
@property (nonatomic, readonly) SCBadgeView *badgeView;
-
When this property is set to YES, a full leading swipe in the cell row performs the first UIContextualAction listed in the actions property. In a left-to-right language environment that is when the user swipes from left to right. The default value of this property is YES.
Warning
Only available in iOS 11 and later.Declaration
Objective-C
@property (nonatomic) BOOL leadingSwipePerformsFirstActionWithFullSwipe;
-
When this property is set to YES, a full trailing swipe in the cell row performs the first UIContextualAction listed in the actions property. In a left-to-right language environment that is when the user swipes from right to left. The default value of this property is YES.
Warning
Only available in iOS 11 and later.Declaration
Objective-C
@property (nonatomic) BOOL trailingSwipePerformsFirstActionWithFullSwipe;
-
Set this property to an array of UIImageView objects to be set to each of the cell’s detail cells.
- - note: Only applicable to cells with detail views.
Declaration
Objective-C
@property (nonatomic, strong) NSArray *detailCellsImageViews;
-
If property is TRUE, the cell gets automatically deselected whenever the user selects it. Default: FALSE.
Declaration
Objective-C
@property (nonatomic) BOOL autoDeselect;
-
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.
Declaration
Objective-C
@property (nonatomic) BOOL autoResignFirstResponder;
-
The cell’s editing style.
Declaration
Objective-C
@property (nonatomic) UITableViewCellEditingStyle cellEditingStyle;
-
Determines if the cell’s value is required. If TRUE, valueIsValid will only return true if the cells value is not empty. Default: FALSE.
Declaration
Objective-C
@property (nonatomic) BOOL valueRequired;
-
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.
Declaration
Objective-C
@property (nonatomic) BOOL autoValidateValue;
-
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.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL valueIsValid;
-
Options for the generated detail view controller (only applicable to subclasses with a detail view controller).
Declaration
Objective-C
@property (nonatomic, readonly) SCDetailViewControllerOptions *detailViewControllerOptions;
-
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.
Declaration
Objective-C
@property (nonatomic, copy) NSString *themeStyle;
-
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.
Declaration
Objective-C
@property (nonatomic) BOOL commitChangesLive;
-
This propery is TRUE if the cell value has changed and needs to be committed. If commitChangesLive is TRUE, this property always remains FALSE.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL needsCommit;
-
Commits any changes to the cell’s value either to the bound object or the bound key where applicable (see class overview).
Declaration
Objective-C
- (void)commitChanges;
-
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).
Declaration
Objective-C
- (void)reloadBoundValue;
-
Is TRUE if the cell is a special cell. Special cells are cells like addNewItemCell or placeholderCell and typically exist within an SCArrayOfItemsSection.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL isSpecialCell;
-
Property should only be used internally by framework.
Declaration
Objective-C
@property (nonatomic) SCDataType boundPropertyDataType;
-
This property represents the bound value of the cell.
Declaration
Objective-C
@property (nonatomic, strong) NSObject *boundValue;
-
Property used internally by framework to change reuseIdentifier after the cell has been created.
Declaration
Objective-C
@property (nonatomic, copy) NSString *reuseId;
-
Property used internally.
Declaration
Objective-C
@property (nonatomic) BOOL configured;
-
Property used internally by framework to determine if cell is being dequed and reused.
Declaration
Objective-C
@property (nonatomic) BOOL beingReused;
-
Property used internally by framework to determine if cell is a custom cell.
Declaration
Objective-C
@property (nonatomic) BOOL customCell;
-
For internal use only.
Declaration
Objective-C
@property (nonatomic) BOOL cellCreatedInIB;
-
For internal use only.
Declaration
Objective-C
@property (nonatomic, copy) NSString *ibDetailViewControllerIdentifier;
-
For internal use only.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL generatesDetailView;
-
Create STV cells from regular UITableViewCells *
Declaration
Objective-C
+ (instancetype)cellWithCell:(UITableViewCell *)cell;
-
Method should be overridden by subclasses to perform any required initialization.
Warning
Subclasses must call [super performInitialization] from within the method’s implementation.Declaration
Objective-C
- (void)performInitialization;
-
Method called internally to rollback the cell’s bound value to its initial state when boundObject was first assigned.
Declaration
Objective-C
- (void)rollbackToInitialBoundValue;
-
Method called internally.
Declaration
Objective-C
- (void)setIsCustomBoundProperty:(BOOL)custom;
-
Method gets called internally whenever the cell value changes.
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.
Declaration
Objective-C
- (void)cellValueChanged;
-
Method gets called internally whenever the cell is about to be displayed.
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.
Declaration
Objective-C
- (void)willDisplay;
-
Method gets called internally whenever the cell gets selected.
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.
Declaration
Objective-C
- (void)didSelectCell;
-
Method gets called internally whenever the cell is about to be deselected.
Declaration
Objective-C
- (void)willDeselectCell;
-
Method gets called internally whenever the cell is deselected.
Declaration
Objective-C
- (void)didDeselectCell;
-
Marks the cell as a special cell.
Declaration
Objective-C
- (void)markCellAsSpecial;
-
Method should be overridden by subclasses to support property attributes.
The method should be able to set the subclass’ specific attributes to its corresponding SCPropertyAttributes subclass.
Declaration
Objective-C
- (void)setAttributesTo:(SCPropertyAttributes *)attributes;
-
Method should be overridden by subclasses to provide subclass specific validation of the cell’s value.
If what you want is to be able to provide custom cell value validation, consider using either the cell’s actions or SCTableViewModelDelegate methods.
Declaration
Objective-C
- (BOOL)getValueIsValid;
-
Method is called internally by the framework before a detail view appears.
Declaration
Objective-C
- (void)prepareCellForDetailViewAppearing;
-
Method is called internally by the framework before a detail view disappears.
Declaration
Objective-C
- (void)prepareCellForDetailViewDisappearing;
-
Method called internally.
Declaration
Objective-C
- (SCTableViewModel *)modelForViewController:(UIViewController *)viewController;
-
Subclasses should override this method to change the returned default detail view controller navigation bar type.
Declaration
Objective-C
- (SCNavigationBarType)defaultDetailViewControllerNavigationBarType;
-
Subclasses should call this method to get a detail view controller.
Declaration
Objective-C
- (UIViewController *)getDetailViewControllerForCell:(SCTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath allowUITableViewControllerSubclass: (BOOL)allowUITableViewController;
-
Subclasses should call this method to present their detail view controller.
Declaration
Objective-C
- (void)presentDetailViewController:(UIViewController *)detailViewController forCell:(SCTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath withPresentationMode:(SCPresentationMode)mode;
-
Subclasses should override this method to configure the generated detail view controller.
Declaration
Objective-C
- (void)configureDetailViewController:(UIViewController *)detailViewController;
-
Subclasses should override this method to build a detail model for the detail view controller.
Declaration
Objective-C
- (void)buildDetailModel:(SCTableViewModel *)detailModel;
-
Subclasses should override this method to configure the detail model for the detail view controller.
Declaration
Objective-C
- (void)configureDetailModel:(SCTableViewModel *)detailModel;
-
Subclasses should override this method to commit the detail model changes.
Declaration
Objective-C
- (void)commitDetailModelChanges:(SCTableViewModel *)detailModel;
-
Subclasses should override this method to handle their detail view controller willPresent. Superclass method must be called.
Declaration
Objective-C
- (void)handleDetailViewControllerWillPresent: (UIViewController *)detailViewController;
-
Subclasses should override this method to handle their detail view controller didPresent. Superclass method must be called.
Declaration
Objective-C
- (void)handleDetailViewControllerDidPresent: (UIViewController *)detailViewController;
-
Subclasses should override this method to handle their detail view controller shouldDismiss. Superclass method must be called.
Declaration
Objective-C
- (BOOL)handleDetailViewControllerShouldDismiss: (UIViewController *)detailViewController cancelButtonTapped:(BOOL)cancelTapped doneButtonTapped:(BOOL)doneTapped;
-
Subclasses should override this method to handle their detail view controller willDismiss. Superclass method must be called.
Declaration
Objective-C
- (void)handleDetailViewControllerWillDismiss: (UIViewController *)detailViewController cancelButtonTapped:(BOOL)cancelTapped doneButtonTapped:(BOOL)doneTapped;
-
Subclasses should override this method to handle their detail view controller didDismiss. Superclass method must be called.
Declaration
Objective-C
- (void)handleDetailViewControllerDidDismiss: (UIViewController *)detailViewController cancelButtonTapped:(BOOL)cancelTapped doneButtonTapped:(BOOL)doneTapped;
-
Method called internally *
Declaration
Objective-C
- (UIViewController *)generatedDetailViewController:(NSIndexPath *)indexPath;