I am using JTAppleCalendar in my iOS application but I am finding it difficult to implement headers that show the month and year at the top of the calendar as a conventional calendar normally would. I have followed instructions in the documentation but I am still finding it difficult despite managing to add 'headers' to show the days of the week albeit I feel maybe not correctly. For anyone who has implemented this library before, can I get some help how to do this? Or maybe another calendar you have used that has an easier way to accomplish this?
I want the screen to look a little like this:
While mine currently looks like this:
Documentation: https://patchthecode.github.io/Headers/
I implement the days of the week as so:
// This sets the height of your header
func calendar(_ calendar: JTAppleCalendarView, sectionHeaderSizeFor range: (start: Date, end: Date), belongingTo month: Int) -> CGSize {
return CGSize(width: 200, height: 50)
}
// This setups the display of your header
func calendar(_ calendar: JTAppleCalendarView, willDisplaySectionHeader header: JTAppleHeaderView, range: (start: Date, end: Date), identifier: String) {
let headerCell = (header as? PinkSectionHeaderView)
headerCell?.title.text = "S M T W T F S"
}