patchthecode / JTAppleCalendar

The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable
https://patchthecode.com
MIT License
7.58k stars 810 forks source link

not able to display days at JTACYearView Calendar #1179

Open zero-tolerance0 opened 5 years ago

zero-tolerance0 commented 5 years ago

(Required) Version Number: version 8.0.2 (commit 8a7c54392f2358c1be91ddf3c0a755ecd5e00f9b) (latest)

Description

I want implement CalendarYearViewController where I expect to see apple default calendar (year view - 12 months) and days inside each month.

I am doing it according to Sample at https://github.com/patchthecode/JTAppleCalendar/blob/master/SampleJTAppleCalendar/Example%20Calendars/TestYearViewViewController.swift

I copied all things from that file (including delegates and datasource) However the func bellow not getting called. func calendar(_ calendar: JTAppleCalendar.JTACYearView, monthView: JTAppleCalendar.JTACCellMonthView, drawingFor segmentRect: CGRect, with date: Date, dateOwner: JTAppleCalendar.DateOwner, monthIndex index: Int){

Steps To Reproduce

Expected Behavior

I expect to reach standard apple calendar behavior when it is YearView (image attached). However I see just Month names at the top of each cell. so I am missing days. Please help

Additional Context

apple standard calendar (expected) standard test year view calendar (current case) my1

patchthecode commented 5 years ago

have you tried the example attached to this repo?

zero-tolerance0 commented 5 years ago

@patchthecode thanks for response, yes, by following steps for launching that with ios version <13 , i finally launched it with TestYearViewController in it.

however when i try to Select "YearView Calendar" in it, it crashes. Saying (please see attached screeenshots):

Invalid datasource Assertion failed: file /Users/compsci/Desktop/swift-projects/JTAppleCalendar-master/Sources/JTAppleCalendar/JTACMonthCell.swift, line 43

photo_2019-11-18_05-31-10

Screen Shot 2019-11-18 at 5 19 11 AM

and second err (when open another Calendars): error with pics Calendar layout is not of type JTAppleCalendarMonthLayout. There was an error in this code section. Please contact the developer on GitHub Assertion failed: file /Users/compsci/Desktop/swift-projects/JTAppleCalendar-master/Sources/JTAppleCalendar/JTACMonthActionFunctions.swift, line 43

Screen Shot 2019-11-18 at 8 36 02 AM

Nevertheless, After seeing source files i found out error at my project - month view appeared after i added to MyCell from storyboard MonthView subclassed from JTACCellMonthView.

Please answer: 1) is there a way to change segment (of each day) rect width height, possibly at: func calendar( calendar: JTAppleCalendar.JTACYearView, monthView: JTAppleCalendar.JTACCellMonthView, drawingFor segmentRect: CGRect, with date: Date, dateOwner: JTAppleCalendar.DateOwner, monthIndex index: Int){_ 2)paging - when i put pagingEnabled = true, the behavior of paging is not so, that Jan, Feb monthes are attached to the very top of View. (after scrolling multiple times, it Jan And Feb months become at center of View)