SCSegmentedCell

@interface SCSegmentedCell : SCControlCell

This class functions as a cell with a UISegmentedControl. The bound property of this cell must be of type NSNumber, int, or NSString.

Creation and Initialization

  • Allocates and returns an initialized SCSegmentedCell 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 SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the UISegmentedControl’s selectedSegmentIndex value. Property must be a readwrite property of type NSNumber.
    • - parameter: cellSegmentTitlesArray An array containing title strings for UISegmentedControl’s segments.

    Declaration

    Objective-C

    + (instancetype)cellWithText:(NSString *)cellText
                             boundObject:(NSObject *)object
        selectedSegmentIndexPropertyName:(NSString *)propertyName
                      segmentTitlesArray:(NSArray *)cellSegmentTitlesArray;
  • Returns an initialized SCSegmentedCell 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 SCTableViewCell class overview).
    • - parameter: propertyName The cell’s bound property name corresponding to the UISegmentedControl’s selectedSegmentIndex value. Property must be a readwrite property of type NSNumber.
    • - parameter: cellSegmentTitlesArray An array containing title strings for UISegmentedControl’s segments.

    Declaration

    Objective-C

    - (instancetype)initWithText:(NSString *)cellText
                             boundObject:(NSObject *)object
        selectedSegmentIndexPropertyName:(NSString *)propertyName
                      segmentTitlesArray:(NSArray *)cellSegmentTitlesArray;

Configuration

  • The UISegmentedControl associated with the cell. Even though this property is readonly, feel free to customize any of the control’s properties.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UISegmentedControl *segmentedControl;
  • Method creates segmented control segments based on the content of the segmentTitlesArray.

    • - parameter: segmentTitlesArray Must be an array of NSString objects.

    Declaration

    Objective-C

    - (void)createSegmentsUsingArray:(NSArray *)segmentTitlesArray;