Latest 1.0.2
Homepage https://github.com/fpotter/ExpandingDatePicker
License MIT
Platforms osx 10.10
Authors

Screenshot

CI Status
Version
License
Platform

ExpandingDatePicker is a textual date picker that will expand to show a
graphical date picker beneath it when focused. It has the same styling
as the expandable date picker Apple uses in Calendar.app.

Installation

ExpandingDatePicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'ExpandingDatePicker'

Usage (Programmatic)

ExpandingDatePicker extends NSDatePicker so the API is the same. Only catch is that it only works for year/month/day elements, in single picker mode and in the textField style.

import ExpandingDatePicker

…

let datePicker = ExpandingDatePicker(frame: .zero)
// Required settings...
datePicker.datePickerElements = .yearMonthDay
datePicker.datePickerMode = .single
datePicker.datePickerStyle = .textField
datePicker.sizeToFit()

…

view.addSubview(datePicker)

Usage (Interface Builder)

Use the Library to add a Date Picker to your view. In the Identity Inspector panel, set the custom class to ExpandingDatePicker.

Requirements

Deployment target of macOS 10.10+, though it has only been tested on 10.14.

Known Issues

  • When the field expands to show the graphical date picker, you’ll notice that the traffic lights in your app’s window will turn gray. The expansion is shown in an NSPanel (a special kind of NSWindow), and when that panel temporarily becomes the app’s key window, the traffic lights go dark. Calendar.app’s version of this expanded date picker doesn’t have this problem because they use a private API.

Author

Fred Potter, [email protected]

License

ExpandingDatePicker is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ExpandingDatePicker",
    "version": "1.0.2",
    "summary": "A textual date picker that expands to show a graphical calendar view when focued.",
    "description": "ExpandingDatePicker is a textual date picker that will expand to show angraphical date picker beneath it when focused.  It has the same stylingnas the expandable date picker Apple uses in Calendar.app.",
    "homepage": "https://github.com/fpotter/ExpandingDatePicker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Fred Potter": "[email protected]"
    },
    "source": {
        "git": "https://github.com/fpotter/ExpandingDatePicker.git",
        "tag": "1.0.2"
    },
    "social_media_url": "https://twitter.com/fpotter",
    "platforms": {
        "osx": "10.10"
    },
    "swift_version": "5.0",
    "source_files": "ExpandingDatePicker/Classes/**/*"
}

Pin It on Pinterest

Share This