patchthecode / JTAppleCalendar

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

update mess #50

Closed akabab closed 8 years ago

akabab commented 8 years ago

Had a crash on JTAppleCalendarHorizontalFlowLayout.swift: line 131 let requestedColumns = Int(ceil(rect.width / itemSize.width)) because itemSize = (0, 0)

so I updated to 4.0.2, but my view layout is now totally broken, is there something more you added to configure now ? I see you changed a lot of stuff on FlowLayout, it is not stable at all.

akabab commented 8 years ago

Else, is there any way to fix the itemSize beeing Zero at that point ?

patchthecode commented 8 years ago

looking into it.

patchthecode commented 8 years ago

Ok.

  1. Which version did you update from?
  2. When you say your layout is totally broken, i need to know what broke. maybe a quick gif? Because 4.0.2 has some performance changes to make it scroll very smoothly on your phone.
akabab commented 8 years ago

4.0.0 -> 4.0.2

I patched 4.0.0 and fixed with guard itemSize.width != 0 else { return nil } because layoutAttributesForElementsInRect is called before updateLayoutItemSize so itemSize is not yet set on first call so let requestedColumns = Int(ceil(rect.width / itemSize.width)) divided by zero makes the crash

akabab commented 8 years ago

But 4.0.2 looks very unstable, uncleaned, with many unused code. Btw, thanks for your reactivity.

patchthecode commented 8 years ago

ok you patched 4.0.0 ? or 4.0.2?

akabab commented 8 years ago

4.0.0

patchthecode commented 8 years ago

hmm. Ok. Aright.

patchthecode commented 8 years ago

But I thought i went through 4.0.2 code with a fine tooth comb. There are no issues from my end. Which code is unused? ...ugh i need details. I dont know where or what problems you are seeing

akabab commented 8 years ago

actually it is not even fixing it, sometimes the cells are not drawn.. anyway I might take a deeper look in 4.0.2

patchthecode commented 8 years ago

I know youre busy with your project. But any help i can get with this project will be awesome. Since im the sole coder >_<

akabab commented 8 years ago

Yeah I was about to propose, will be able to help in a couple of week when I'm back from holiday. I'm leaving tomorrow, and I don't get why this issue popped up from nowhere without updating the lib, it now crash instantly on loading the view..

patchthecode commented 8 years ago

OK. Before you go. you mentioned that cells are not being Drawn. Are you registering cells with a Xib file -> calendarView.registerCellViewXib(fileName: "CellView") ? or Are you registering cells with class -> calendarView.registerCellViewClass(fileName: "JTAppleCalendar_Example.CodeCellView")

patchthecode commented 8 years ago

Request sent

patchthecode commented 8 years ago

Ok. Bug was due to iOS simulator in an inconsistent state. Closing this issue.

patchthecode commented 8 years ago

If, you're back. Do an update to 4.1.0 I found the issue that was causing this issue.