SwiftUI simple calendar view for displaying specified month's days. Supports iOS v14.
Simple, easy-to-use or change calendar view. Feel free to take and change on your behalf.
Repository includes a package SimpleCalendar for install and project SimpleCalendarExample with example of usage.
- Ease-to-use API: give to SimpleCalendar month and year numbers, or just a
Date
- Use your own calendar configuration, or use default configuration
.localizedCurrent
, which isCalendar
instance, localized with app's preferred language - Configure font size
- Choose built-in styles of calendar's header - localized short, full or completely off day titles
- Configure header padding or cell spacing
- Use built-in modifier
.calendarTintColor()
to change SimpleCalendar tint color appearence
SPM
installation: in Xcode tap «File → Add packages…», paste is search field the URL of this page and press «Add package».
Annotate SwiftUI
file with «import SimpleCalendar». Then pass to SimpleCalendarView month and year Int
's or just a Date
:
SimpleCalendarView(
month: 9,
year: 2023,
calendar: .localizedCurrent,
fontSize: 18,
verticalCellPadding: 10,
weekdayHeaderPadding: 15,
weekdaySymbolFormat: .short
)
.padding(15)
.calendarTintColor(.orange)