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

Inheritance


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.4 and later.
  • isBezeled isBezeled Available in OS X v10.4 through OS X v10.9

    Returns whether the receiver has a bezeled border.

    Declaration

    Objective-C

    - (BOOL)isBezeled

    Return Value

    TRUE if the receiver has a bezeled border, FALSE otherwise.

    Import Statement

    Availability

    Available in OS X v10.4 through OS X v10.9.

    See Also

    – setBezeled:

  • Specifies whether the receiver draws a bezeled border.

    Declaration

    Swift

    var bezeled: Bool

    Objective-C

    @property(getter=isBezeled) BOOL bezeled

    Parameters

    flag

    TRUE if the receiver has a bezeled border, FALSE otherwise.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – isBezeled

  • isBordered isBordered Available in OS X v10.4 through OS X v10.9

    Returns whether the receiver has a plain border.

    Declaration

    Objective-C

    - (BOOL)isBordered

    Return Value

    TRUE if the receiver has a plain border, FALSE otherwise.

    Import Statement

    Availability

    Available in OS X v10.4 through OS X v10.9.

  • Specifies whether the receiver draws a plain border.

    Declaration

    Swift

    var bordered: Bool

    Objective-C

    @property(getter=isBordered) BOOL bordered

    Parameters

    flag

    TRUE if the receiver has a plain border, FALSE otherwise.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – isBordered

  • Returns the background color of the receiver.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor

    Objective-C

    @property(copy) NSColor *backgroundColor

    Return Value

    The background color of the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s background color.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor

    Objective-C

    @property(copy) NSColor *backgroundColor

    Parameters

    color

    The new background color.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns whether the receiver draws the background.

    Declaration

    Swift

    var drawsBackground: Bool

    Objective-C

    @property BOOL drawsBackground

    Return Value

    TRUE if the receiver draws the background, FALSE otherwise.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Specifies whether the receiver draws the background.

    Declaration

    Swift

    var drawsBackground: Bool

    Objective-C

    @property BOOL drawsBackground

    Parameters

    flag

    TRUE if the receiver draws the background, FALSE otherwise.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the text color of the receiver.

    Declaration

    Swift

    @NSCopying var textColor: NSColor

    Objective-C

    @property(copy) NSColor *textColor

    Return Value

    The text color of the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the text color of the receiver.

    Declaration

    Swift

    @NSCopying var textColor: NSColor

    Objective-C

    @property(copy) NSColor *textColor

    Parameters

    color

    The new text color.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – textColor

  • Returns the receiver’s date picker style.

    Declaration

    Swift

    var datePickerStyle: NSDatePickerStyle

    Objective-C

    @property NSDatePickerStyle datePickerStyle

    Return Value

    The receiver’s date picker style.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s date picker style.

    Declaration

    Swift

    var datePickerStyle: NSDatePickerStyle

    Objective-C

    @property NSDatePickerStyle datePickerStyle

    Parameters

    newStyle

    The new date picker style.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the delegate of the receiver’s date picker cell.

    Declaration

    Swift

    unowned(unsafe) var delegate: NSDatePickerCellDelegate?

    Objective-C

    @property(assign) id<NSDatePickerCellDelegate> delegate

    Return Value

    The delegate of the receiver’s date picker cell.

    Discussion

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the delegate of the receiver’s date picker cell.

    Declaration

    Swift

    unowned(unsafe) var delegate: NSDatePickerCellDelegate?

    Objective-C

    @property(assign) id<NSDatePickerCellDelegate> delegate

    Parameters

    anObject

    The new delegate.

    Discussion

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – delegate

  • Returns 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

    Return Value

    A bitmask that specifies the date picker elements displayed by the receiver. See “Constants” in NSDatePickerCell for a description of the possible values.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets 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

    Parameters

    elementFlags

    A bitmask that specifies the date picker elements displayed by the receiver. See “Constants” in NSDatePickerCell for a description of the possible values.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the calendar used by the receiver.

    Declaration

    Swift

    @NSCopying var calendar: NSCalendar?

    Objective-C

    @property(copy) NSCalendar *calendar

    Return Value

    The calendar used by the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s calendar.

    Declaration

    Swift

    @NSCopying var calendar: NSCalendar?

    Objective-C

    @property(copy) NSCalendar *calendar

    Parameters

    newCalendar

    The new calendar.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – calendar

  • Returns the receiver’s locale.

    Declaration

    Swift

    @NSCopying var locale: NSLocale?

    Objective-C

    @property(copy) NSLocale *locale

    Return Value

    The receiver’s locale.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – setLocale:

  • Sets the receiver’s locale.

    Declaration

    Swift

    @NSCopying var locale: NSLocale?

    Objective-C

    @property(copy) NSLocale *locale

    Parameters

    newLocale

    The new locale.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – locale

  • Returns the receiver’s date picker mode.

    Declaration

    Swift

    var datePickerMode: NSDatePickerMode

    Objective-C

    @property NSDatePickerMode datePickerMode

    Return Value

    The receiver’s date picker mode.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s date picker mode.

    Declaration

    Swift

    var datePickerMode: NSDatePickerMode

    Objective-C

    @property NSDatePickerMode datePickerMode

    Parameters

    newMode

    The new date picker mode.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the receiver’s time zone.

    Declaration

    Swift

    @NSCopying var timeZone: NSTimeZone?

    Objective-C

    @property(copy) NSTimeZone *timeZone

    Return Value

    The receiver’s time zone.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s time zone.

    Declaration

    Swift

    @NSCopying var timeZone: NSTimeZone?

    Objective-C

    @property(copy) NSTimeZone *timeZone

    Parameters

    newTimeZone

    The new time zone.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – timeZone

  • Returns the receiver’s date.

    Declaration

    Swift

    @NSCopying var dateValue: NSDate

    Objective-C

    @property(copy) NSDate *dateValue

    Return Value

    The receiver’s date.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s date to a new starting value.

    Declaration

    Swift

    @NSCopying var dateValue: NSDate

    Objective-C

    @property(copy) NSDate *dateValue

    Parameters

    newStartDate

    The new starting date.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – dateValue

  • Returns the time interval that represents the date range.

    Declaration

    Swift

    var timeInterval: NSTimeInterval

    Objective-C

    @property NSTimeInterval timeInterval

    Return Value

    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.

    Special Considerations

    Prior to OS X v 10.5, this method always returned 0.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the time interval of the date range.

    Declaration

    Swift

    var timeInterval: NSTimeInterval

    Objective-C

    @property NSTimeInterval timeInterval

    Parameters

    newTimeInterval

    The new time interval.

    Discussion

    The time interval only applies when the receiver is in the NSRangeDateMode mode.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the minimum date value the receiver allows as input.

    Declaration

    Swift

    @NSCopying var minDate: NSDate?

    Objective-C

    @property(copy) NSDate *minDate

    Return Value

    The minimum date value the receiver allows as input. nil indicates no minimum date.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – setMinDate:

  • Sets the minimum date allowed as input by the receiver.

    Declaration

    Swift

    @NSCopying var minDate: NSDate?

    Objective-C

    @property(copy) NSDate *minDate

    Parameters

    date

    The minimum date allowed as input by the receiver. nil indicates no minimum date.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – minDate

  • Returns the maximum date value the receiver allows as input.

    Declaration

    Swift

    @NSCopying var maxDate: NSDate?

    Objective-C

    @property(copy) NSDate *maxDate

    Return Value

    The maximum date value the receiver allows as input. nil indicates no maximum date.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – setMaxDate:

  • Sets the maximum date allowed as input by the receiver.

    Declaration

    Swift

    @NSCopying var maxDate: NSDate?

    Objective-C

    @property(copy) NSDate *maxDate

    Parameters

    date

    The maximum date allowed as input by the receiver. nil indicates no maximum date.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – maxDate