-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug on mutiple selection #64
Comments
looking into it now. |
One thing, you do have Can you show me your |
Yep! override func viewDidLoad() {
super.viewDidLoad()
configureCalendar()
configureHeader()
configureTableView()
configureCalendarHeader()
createDateFilterPicker()
} I setup the calendar on the configureCalendar method. func configureCalendar() {
calendarView.dataSource = self
calendarView.delegate = self
self.calendarView.registerCellViewXib(fileName: "DateCellView")
calendarView.cellInset = CGPoint(x: 0, y: 0)
calendarView.allowsMultipleSelection = true
} I can't share the whole project, but if you need any part of the code just let me know! |
Hi @patchthecode, could you simulate the bug? If you need any help just let me know. 👍 |
Sorry I didnt get back to you. But I will be pushing the fix to the master branch today. I'll let you know once I do the push so that you can check to see if the fix works before i do the release. Sounds good? :] |
Perfect! I'm pretty curious to know what was the problem and the solution for that! Sure! As soon as you push your solution I will test it on my side. Could you share the project that you are using to simulate this bug? |
The sample project I am using to simulate it is the sample project here on github. I havent pushed the changes yet though. And as for the bug simulation, I no longer see the bug on my end. One sec, let me send you the zip file of my local sample project. I'm just wrapping up some other code parts form it. |
7 hrs later.. still working on it. When I push it today, i'll let you know |
Thank you for the hard work and the constant feedbacks @patchthecode! |
Do you know how to test the master branch code? |
I think so, I'm using cocoapods, so I did this: I think its using the current master branch. Testing it.. :) |
Everything is working fine here! Thank you @patchthecode! What was the bug? I see now that the deselection always happens before the selection, it was kind of random before. |
if you do a deselection before a selection, then the deselection should always happen before the selection. nothing should be random. if you encounter anything weird like that again, even if it is a tiny tiny tiny issue, then please let me know. The multi-selection bug was occurring because of an error i had in the desselection process. i was deselecting the indexPath that the user wanted to select instead of the oldIndexPath that should have been deselected. I used the wrong variable name (index vs oldIndex). It must have been late that night when i did that code set. |
by the way, i put in a new function because of you, and yes, your English is perfect 👍 I'll do the official release sometime later. cheers |
Thank you! This new function will be really useful! Good work on this calendar! it's very flexible and provides a lot of good built-in functionalities. I will recommend it for sure! |
Thanks! closing this issue. will make an official release soon. |
Hi,
It will be hard to explain it in english, but I will give a try ;P.
I have a application with a filter on the top in which I can select a whole week for example, I also have 2 buttons on the top in which I can go to the next week or to the previous week. Here is my screen:
In order to to go to the previous week or to the next week, I deselect the current selected week and select the next one, everything works fine when I press the buttons slowly. However, we I press the next or the previous repeatedly, at some point, the selector become crazy, and I lost the reference of the weeks, or it gives an weird crash (fatal error: Index out of range).
The crash breakpoint:
And the crazy selection (It should be selecting from 10-16, but it's not selecting the 12, and selecting the 17):
Here is my code:
The unselectSelectedDates function:
After further investigation, I figured out that the unselect and selection delegate methods, are called asynchronously, and it could be causing the problem, but I couldn't find a easy solution for that, do you have any ideas?
The text was updated successfully, but these errors were encountered: