gkopel / nmdatepicker

NSDatePicker replacement allowing for appearance customisation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NMDatePicker: Custom OS X Date Picker

NSDatePicker replacement allowing for appearance customisation.

Preview

NMDatePicker preview

Features

  • custom date picker size
  • custom font size and colour
  • custom colours for date picker background, selected day, highlighted day
  • particular days can be marked with a bullet symbol
  • can be created in code or in Interface Builder

Installation

  • Add NMDatePicker.swift and NMDatePickerDayView.swift to your project
  • Set NMDatePicker object as a delegate and implement delegate methods

Requirements

  • OS X 10.11 or later
  • Swift 5.0 or later

Delegate Methods

/* 
This method notifies about the date selected in the date picker.
*/
func nmDatePicker(_ datePicker: NMDatePicker, selectedDate: Date)   
/*
Optional method that allows to adjust date picker height   
when the number of rows is changing between months.    
*/
optional func nmDatePicker(_ datePicker: NMDatePicker, newSize: NSSize) 

You can use analogous methods in Objective-C code.

Demo Apps

NMDate Picker can be used from both Swift and Objective-C code. See demo apps:

  • TestApp1: example Swift application containing NMDatePicker view created in code.
  • TestApp2: example Swift application containing NMDatePicker view created in Interface Builder.

License

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

About

NSDatePicker replacement allowing for appearance customisation.

License:MIT License


Languages

Language:Swift 98.7%Language:Objective-C 1.3%