Jtapplecalendar: "Bottom border" for each week in calendar

Created on 29 May 2017  路  4Comments  路  Source: patchthecode/JTAppleCalendar

Hey there, great library! Been really easy to set my calendar up. Just running into one issue right now. I would like to have a "bottom border" for each week in the month and currently I am doing this:
cell.contentView.addBorder(side: .bottom, thickness: 1, color: UIColor(colorWithHexValue: 0x292C49))
inside the cellForItemAt. I am getting the desired view however after changing the months few times, I am seeing that the border is being drawn multiple times. Is there a better way to do this?

Note the addBorder() function is an extension to UIView I added.

screen shot 2017-05-28 at 6 39 47 pm

screen shot 2017-05-28 at 6 39 59 pm

Thank you!

Most helpful comment

the fastest way to make lines i would think is by changing one of the spacing to 1.

calendarView.minimumLineSpacing = 1
//Or
calendarView.minimumInteritemSpacing = 1

This would leave either a vertical or horizontal space. Depending on the background color of your cells (black) and the background color of the calendarView itself (blue)

All 4 comments

the fastest way to make lines i would think is by changing one of the spacing to 1.

calendarView.minimumLineSpacing = 1
//Or
calendarView.minimumInteritemSpacing = 1

This would leave either a vertical or horizontal space. Depending on the background color of your cells (black) and the background color of the calendarView itself (blue)

@patchthecode genius! Worked out perfectly.

Thank you!

calendarView.minimumLineSpacing = 1
calendarView.minimumInteritemSpacing = 1

Value of type 'JTAppleCalendarView' has no member 'minimumLineSpacing'
Value of type 'JTAppleCalendarView' has no member 'minimumInteritemSpacing'

calendarView.calendarView.minimumLineSpacing = 1
calendarView.calendarView.minimumInteritemSpacing = 1

'calendarView' is inaccessible due to 'internal' protection level
'calendarView' is inaccessible due to 'internal' protection level

@tkirby what version are you using?
it should be 7.0.5

Was this page helpful?
0 / 5 - 0 ratings