Mac Developer Library

Developer

AppKit Framework Reference NSDatePicker Class Reference

Options
Deployment Target:

On This Page
Language:

NSDatePicker

NSDatePicker is a subclass of NSControl that provides a user interface for displaying and editing an NSDate object.

NSDatePicker uses an NSDatePickerCell to implement much of the control’s functionality. NSDatePicker provides cover methods for most of NSDatePickerCell methods, which invoke the corresponding cell method.

  • A Boolean value that indicates whether the date picker draws a bezeled border.

    Declaration

    Swift

    var bezeled: Bool

    Objective-C

    @property(getter=isBezeled) BOOL bezeled

    Discussion

    This property contains YEStrue if the date picker has a bezeled boarder; otherwise, NOfalse.

    Availability

    Available in OS X v10.4 and later.

  • A Boolean value that indicates whether the date picker has a plain border.

    Declaration

    Swift

    var bordered: Bool

    Objective-C

    @property(getter=isBordered) BOOL bordered

    Discussion

    This property contains YEStrue if the date picker has a plain boarder; otherwise, NOfalse.

    Availability

    Available in OS X v10.4 and later.

  • The date picker’s background color.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor

    Objective-C

    @property(copy) NSColor *backgroundColor

    Availability

    Available in OS X v10.4 and later.

  • A Boolean value that indicates whether the date picker draws the background.

    Declaration

    Swift

    var drawsBackground: Bool

    Objective-C

    @property BOOL drawsBackground

    Availability

    Available in OS X v10.4 and later.

  • The date picker’s text color.

    Declaration

    Swift

    @NSCopying var textColor: NSColor

    Objective-C

    @property(copy) NSColor *textColor

    Availability

    Available in OS X v10.4 and later.

  • The date picker’s style.

    Declaration

    Swift

    var datePickerStyle: NSDatePickerStyle

    Objective-C

    @property NSDatePickerStyle datePickerStyle

    Availability

    Available in OS X v10.4 and later.

  • A delegate for the date picker’s cell

    Declaration

    Swift

    unowned(unsafe) var delegate: NSDatePickerCellDelegate?

    Objective-C

    @property(assign) id< NSDatePickerCellDelegate > delegate

    Discussion

    The date picker’s NSDatePickerCell instance handles all delegate methods.

    Availability

    Available in OS X v10.4 and later.

  • A bitmask that indicates which visual elements of the date picker are currently shown, and which won't be usable because they are hidden.

    Declaration

    Swift

    var datePickerElements: NSDatePickerElementFlags

    Objective-C

    @property NSDatePickerElementFlags datePickerElements

    Discussion

    See “Constants” in NSDatePickerCell for a description of the possible values.

    Availability

    Available in OS X v10.4 and later.

  • The date selected by the date picker.

    Declaration

    Swift

    @NSCopying var dateValue: NSDate

    Objective-C

    @property(copy) NSDate *dateValue

    Discussion

    When selecting a date range, this property represents the time intervals starting date.

    Availability

    Available in OS X v10.4 and later.

  • The time interval selected by the date picker.

    Declaration

    Swift

    var timeInterval: NSTimeInterval

    Objective-C

    @property NSTimeInterval timeInterval

    Discussion

    The time interval that represents the receiver’s date range. The date range begins at the date returned by dateValue. This method returns 0 when the receiver is not in the NSRangeDateMode mode.

    Availability

    Available in OS X v10.4 and later.

  • The date picker’s minimum date value.

    Declaration

    Swift

    @NSCopying var minDate: NSDate?

    Objective-C

    @property(copy) NSDate *minDate

    Discussion

    This property represents the minimum value that the date picker allows as input. nil indicates no maximum date.

    Availability

    Available in OS X v10.4 and later.

  • The date picker’s maximum date value.

    Declaration

    Swift

    @NSCopying var maxDate: NSDate?

    Objective-C

    @property(copy) NSDate *maxDate

    Discussion

    This property represents the maximum value that the date picker allows as input. nil indicates no maximum date.

    Availability

    Available in OS X v10.4 and later.