ios - Showing Months and year as header through JTAppleCalendar -


i using jtapplecalendar in ios application finding difficult implement headers show month , year @ top of calendar conventional calendar would. have followed instructions in documentation still finding difficult despite managing add 'headers' show days of week albeit feel maybe not correctly. has implemented library before, can how this? or maybe calendar have used has easier way accomplish this?

i want screen little this: enter image description here

while mine looks this: enter image description here

documentation: https://patchthecode.github.io/headers/

i implement days of week so:

    // sets height of header func calendar(_ calendar: jtapplecalendarview, sectionheadersizefor range: (start: date, end: date), belongingto month: int) -> cgsize {     return cgsize(width: 200, height: 50) } // setups display of 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" } 

i think made whole lot more difficult should be.

what saw on tutorial site example of how can setup header simple uilabel on called title. not have follow if calendar design different. design wish.

it seems want not uilabel. want 7 labels; each representing day of week. easiest way create 7 uilabels inside of horizontal stackiew. stackview's spacing should set full , should set fill equally. have click on individual labels , set alignment center.

enter image description here

make constraints of stackview stretch ends of headerview. done. s|m|t|w|t|f|s view complete without hard coding spaces; bad thing do.

next seems want 2 labels. 1 month, , year. create labels in header view, , create outletlets them. can set them in following function.

func calendar(_ calendar: jtapplecalendarview, willdisplaysectionheader header: jtappleheaderview, range: (start: date, end: date), identifier: string) { } 

Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -