[Japanese][English]
This is a Swift conversion of Gyetván András's repository Calendar-OSX which is written in Objective-C.
Basic function is same as original.
Here, I describe the difference between original:
- Fix for crash on empty calendar cell selection.
- Fix for misplacing of bottom line and default selection circle.
- Chaned top line into bottom line. It's my favorite. ;-P
- Add coloring of Sunday and Saturday.
- Add Support for switching to dark mode.
- Add Japanese Holiday coloring (Using fumiyasac's CalculateCalendarLogic.swift) in Japanese localization.
Usage is same as original. In Summary:
-
Copy all the files in the MLCalendar group to your project.
-
MLCalendarView is subclass of NSViewController which can be used as any other view.
-
You can change the default colors used by the calendar by the properties as follows:
var backgroundColor: NSColor? var textColor: NSColor? var holiDayColor: NSColor? var saturDayColor: NSColor? var selectionColor: NSColor? var todayMarkerColor: NSColor? var dayMarkerColor: NSColor
-
Off cource, Calendar-OSX-Swift have delegate same as original.
protocol MLCalendarViewDelegate { func didSelectDate(selectedDate: Date) }
The Xcode project is sample of Calendar-OSX-Swift using NSPopover, same as original.