SCDateCell

@interface SCDateCell : SCLabelCell <SCViewControllerDelegate> {
  UITextField *_pickerField;
  UIViewController *_activePickerDetailViewController;
  UIDatePicker *datePicker;
  NSDateFormatter *dateFormatter;
  BOOL displaySelectedDate;
}

This class functions as a cell that provides the end-user with a UIDatePicker to choose a date with. The bound property of this cell must be of type NSDate.

Creation and Initialization

  • Allocates and returns an initialized SCDateCell 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 cell’s date selection. Property must be a readwrite property of type NSDate.

    Declaration

    Objective-C

    + (instancetype)cellWithText:(NSString *)cellText
                     boundObject:(NSObject *)object
                datePropertyName:(NSString *)propertyName;
  • Returns an initialized SCDateCell 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 cell’s date selection. Property must be a readwrite property of type NSDate.

    Declaration

    Objective-C

    - (instancetype)initWithText:(NSString *)cellText
                     boundObject:(NSObject *)object
                datePropertyName:(NSString *)propertyName;

Configuration

  • The UIDatePicker control 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) UIDatePicker *datePicker;
  • Set to customize how the cell display’s the selected date.

    Declaration

    Objective-C

    @property (nonatomic, strong) NSDateFormatter *dateFormatter;
  • If TRUE, the cell displays the selected date in a left aligned label. Default: TRUE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL displaySelectedDate;
  • A placeholder string that appears when no date is selected. Default: nil.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *placeholder;
  • Set to TRUE to display the date picker as a keyboard input accessory view that appears from the bottom of the screen, instead of displaying it inside the cell. Default: FALSE.

    Declaration

    Objective-C

    @property (nonatomic) BOOL displayDatePickerAsInputAccessoryView;