Bootstrap of WenchaoD's FSCalendar framework. FSCalendarBootstrap is an easy, out-of-the-box calendar class designed for iOS applications. It was designed to implement an option to change the calendar’s year.
Copy CalendarView.swift into your project directory. Extend classes that use CalendarView with CalendarDelegate.
You must include WenchaoD's FSCalendar files into your project. Please visit his github (linked above) to learn how.
NOTE: FSCalendarBootstrap uses the FSCalendar framework which is written in Objective-C. To get it to work with Swift projects, you must include a bridging header
After you have successfully added FSCalendar and FSCalendarBootstrap and a bridging header to your project, follow the following steps:
- Extend your class with CalendarDelegate
- Create you calendar variable
- Initialize your CalendarView variable giving it a frame, minimum date, and maximum date
- Assign the calendar's delegate
- Subclass your CalendarView variable under your controller's view
To assign an action to a date being selected, implement func didSelect(date: Date)
.
To change the maximum or minimum date after initialization, implement func maximumDate() -> Date
or func minimumDate() -> Date
. These functions should return the desired maximum or minimum date.
The calendar's appearance can be changed by changing the following variables:
- headerDateFormat
- scrollDirection
- allowsMultipleSelection
- firstWeekday
- weekdayTextColor
- headerTitleColor
- eventDefaultColor
- eventSelectionColor
- selectionColor
- todayColor
- todaySelectionColor
- yearTextColor
- titleTodayColor
- borderRadius
- calendarColor
- headerColor
Please see the Examples folder for examples of how FSCalendarBootstrap can be used.
Any additional functionalities that are not currently implemented into the bootstrap can be found on WenchaoD's FSCalendar github page.
This project is licensed under the MIT License - see the LICENSE file for details.
Thank you to WenchaoD for the FSCalendar framework.