Mac Developer Library

Developer

AppKit Framework Reference NSDatePickerCell Class Reference

Options
Deployment Target:

On This Page
Language:

NSDatePickerCell

An NSDatePickerCell instance controls the behavior of an NSDatePicker control, or of a single date picker cell in a matrix.

Inheritance


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.4 and later.
  • The cell’s background color.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor

    Objective-C

    @property(copy) NSColor *backgroundColor

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • A Boolean value indicating whether the cell draws its background.

    Declaration

    Swift

    var drawsBackground: Bool

    Objective-C

    @property BOOL drawsBackground

    Discussion

    When the value of this property is YEStrue, the cell draws its background.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • textColor textColor Property

    The cell’s text color.

    Declaration

    Swift

    @NSCopying var textColor: NSColor

    Objective-C

    @property(copy) NSColor *textColor

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The date picker style to use.

    Declaration

    Swift

    var datePickerStyle: NSDatePickerStyle

    Objective-C

    @property NSDatePickerStyle datePickerStyle

    Discussion

    For a list of possible values, see NSDatePickerStyle.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • A bitmask that indicates which visual elements are shown by the date picker.

    Declaration

    Swift

    var datePickerElements: NSDatePickerElementFlags

    Objective-C

    @property NSDatePickerElementFlags datePickerElements

    Discussion

    Elements not included in the bitmask are hidden from view. For a list of possible values, see NSDatePickerElementFlags.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • dateValue dateValue Property

    The date currently specified in the picker.

    Declaration

    Swift

    @NSCopying var dateValue: NSDate

    Objective-C

    @property(copy) NSDate *dateValue

    Discussion

    Assign a date to this property to set the starting value for the picker. For range-based dates, use the timeInterval property to set the extent of the time range.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The time interval that represents the date range.

    Declaration

    Swift

    var timeInterval: NSTimeInterval

    Objective-C

    @property NSTimeInterval timeInterval

    Discussion

    The date range begins at the date in the dateValue property. The value in this property applies only when the date picker is in the NSRangeDateMode mode.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • calendar calendar Property

    The calendar used by the date picker.

    Declaration

    Swift

    @NSCopying var calendar: NSCalendar?

    Objective-C

    @property(copy) NSCalendar *calendar

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • locale locale Property

    The locale used to display dates.

    Declaration

    Swift

    @NSCopying var locale: NSLocale?

    Objective-C

    @property(copy) NSLocale *locale

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • timeZone timeZone Property

    The time zone used to display time-related values.

    Declaration

    Swift

    @NSCopying var timeZone: NSTimeZone?

    Objective-C

    @property(copy) NSTimeZone *timeZone

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • minDate minDate Property

    The minimum date that the picker allows as input.

    Declaration

    Swift

    @NSCopying var minDate: NSDate?

    Objective-C

    @property(copy) NSDate *minDate

    Discussion

    Set this property to nil if you want to allow any value for the minimum date.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    maxDate

  • maxDate maxDate Property

    The maximum date that the picker allows as input.

    Declaration

    Swift

    @NSCopying var maxDate: NSDate?

    Objective-C

    @property(copy) NSDate *maxDate

    Discussion

    Set this property to nil if you want to allow any value for the maximum date.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    minDate

  • Constants that define the visual appearance of the date picker cell.

    Declaration

    Swift

    enum NSDatePickerStyle : UInt { case TextFieldAndStepperDatePickerStyle case ClockAndCalendarDatePickerStyle case TextFieldDatePickerStyle }

    Objective-C

    typedef enum NSDatePickerStyle : NSUInteger { NSTextFieldAndStepperDatePickerStyle = 0, NSClockAndCalendarDatePickerStyle = 1, NSTextFieldDatePickerStyle = 2 } NSDatePickerStyle;

    Constants

    • TextFieldAndStepperDatePickerStyle

      NSTextFieldAndStepperDatePickerStyle

      Provide a text field and stepper style interface.

      Available in OS X v10.4 and later.

    • ClockAndCalendarDatePickerStyle

      NSClockAndCalendarDatePickerStyle

      Provide a visual clock and calendar style interface.

      Available in OS X v10.4 and later.

    • TextFieldDatePickerStyle

      NSTextFieldDatePickerStyle

      Provide a text field interface.

      Available in OS X v10.5 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Constants that define whether the picker provides a single date, or a range of dates.

    Declaration

    Swift

    enum NSDatePickerMode : UInt { case SingleDateMode case RangeDateMode }

    Objective-C

    typedef enum NSDatePickerMode : NSUInteger { NSSingleDateMode = 0, NSRangeDateMode = 1 } NSDatePickerMode;

    Constants

    • SingleDateMode

      NSSingleDateMode

      Allow selection of a single date.

      Available in OS X v10.4 and later.

    • RangeDateMode

      NSRangeDateMode

      Allow selection of a range of dates. (First implemented in OS X v 10.5.)

      Available in OS X v10.4 and later.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Constants that specify the date and time elements displayed by the picker.

    Declaration

    Swift

    struct NSDatePickerElementFlags : RawOptionSetType { init(_ rawValue: UInt) init(rawValue rawValue: UInt) static var HourMinuteDatePickerElementFlag: NSDatePickerElementFlags { get } static var HourMinuteSecondDatePickerElementFlag: NSDatePickerElementFlags { get } static var TimeZoneDatePickerElementFlag: NSDatePickerElementFlags { get } static var YearMonthDatePickerElementFlag: NSDatePickerElementFlags { get } static var YearMonthDayDatePickerElementFlag: NSDatePickerElementFlags { get } static var EraDatePickerElementFlag: NSDatePickerElementFlags { get } }

    Objective-C

    typedef enum NSDatePickerElementFlags : NSUInteger { NSHourMinuteDatePickerElementFlag = 0x000c, NSHourMinuteSecondDatePickerElementFlag = 0x000e, NSTimeZoneDatePickerElementFlag = 0x0010, NSYearMonthDatePickerElementFlag = 0x00c0, NSYearMonthDayDatePickerElementFlag = 0x00e0, NSEraDatePickerElementFlag = 0x0100, } NSDatePickerElementFlags;

    Constants

    • HourMinuteDatePickerElementFlag

      NSHourMinuteDatePickerElementFlag

      Display and allow editing of the hour and minute elements of the date.

      Available in OS X v10.4 and later.

    • HourMinuteSecondDatePickerElementFlag

      NSHourMinuteSecondDatePickerElementFlag

      Display and allow editing of the hour, minute and second elements of the date.

      Available in OS X v10.4 and later.

    • TimeZoneDatePickerElementFlag

      NSTimeZoneDatePickerElementFlag

      Display and allow editing of the time zone.

      This flag has been declared for possible future use, and does not yet have any effect.

      Available in OS X v10.4 and later.

    • YearMonthDatePickerElementFlag

      NSYearMonthDatePickerElementFlag

      Display and allow editing of the year and month elements of the date.

      Available in OS X v10.4 and later.

    • YearMonthDayDatePickerElementFlag

      NSYearMonthDayDatePickerElementFlag

      Display and allow editing of the year, month and day elements of the date.

      Available in OS X v10.4 and later.

    • EraDatePickerElementFlag

      NSEraDatePickerElementFlag

      Display and allow editing of the era of the date, if applicable.

      This flag has been declared for possible future use, and does not yet have any effect.

      Available in OS X v10.4 and later.

    Discussion

    You can combine these constants using the C bitwise OR operator.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.