https://github.com/thierryh91200/thcalendar
Calendar like iOS
https://github.com/thierryh91200/thcalendar
calendar collection-view collectionview customizable ical icalendar macos osx swift4
Last synced: 11 months ago
JSON representation
Calendar like iOS
- Host: GitHub
- URL: https://github.com/thierryh91200/thcalendar
- Owner: thierryH91200
- License: apache-2.0
- Created: 2017-10-18T13:45:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-09T11:51:00.000Z (over 4 years ago)
- Last Synced: 2025-04-11T17:15:27.999Z (about 1 year ago)
- Topics: calendar, collection-view, collectionview, customizable, ical, icalendar, macos, osx, swift4
- Language: Swift
- Homepage:
- Size: 774 KB
- Stars: 21
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://bettercodehub.com/)
# THCalendar
CalendarView framework written in Swift for OS X

# Usage
## Initialize the Calendar View
```
let calendarView = THCalendarView()
```
## Overriding Preferences
```
var preferences = THCalendarView.globalPreferences
preferences.calendar.textColor = NSColor.darkGray
preferences.calendar.cellColorDefault = NSColor(white: 0.0, alpha: 0.1)
preferences.calendar.cellColorToday = NSColor.darkGray
preferences.calendar.borderColor = NSColor.red
preferences.calendar.backgroundColors = NSColor.darkGray
preferences.calendar.beginWeek = .monday
preferences.date.circleBackgroundColor = NSColor.yellow
preferences.date.dotColor = #colorLiteral(red: 0, green: 0.9768045545, blue: 0, alpha: 1)
THCalendarView.globalPreferences = preferences
```
## Add Calendar to the view hierarchy
```
addChildViewController(calendarView)
calendarView.view.frame = containerView.frame
view.addSubview(calendarView.view)
```
## Set the calendar properties
```
calendarView.counts = generateCounts()
calendarView.selectedDate = Date()
```