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.

Inheritance


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.4 and later.
  • bezeled bezeled Property

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.10 and later.

  • bordered bordered Property

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.10 and later.

  • The date picker’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 that indicates whether the date picker draws the background.

    Declaration

    Swift

    var drawsBackground: Bool

    Objective-C

    @property BOOL drawsBackground

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • textColor textColor Property

    The date picker’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’s style.

    Declaration

    Swift

    var datePickerStyle: NSDatePickerStyle

    Objective-C

    @property NSDatePickerStyle datePickerStyle

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • delegate delegate Property

    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.

    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 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.

    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 date picker’s locale.

    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.

  • The date picker’s mode.

    Declaration

    Swift

    var datePickerMode: NSDatePickerMode

    Objective-C

    @property NSDatePickerMode datePickerMode

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • timeZone timeZone Property

    The time zone for the date picker.

    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.

  • dateValue dateValue Property

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • minDate minDate Property

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • maxDate maxDate Property

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.