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
Update after Event Changes #267
Comments
|
@justdan0227 Yes it's as described by @danielbmarques. If you've further remarks, please let me know otherwise closed. |
@elsesiy One problem with this is that it literally refreshes just the presented month, so if there are changes in the previous or next month they aren't refreshed. I'm sorry for pointing out so many problems. Great work on this library overall, though. I love it. :) |
@danielbmarques Thank you and no worries, it's fine :) You're absolutely right, as the signature states this func only refreshes the presented month. We should definitely add a func to update all months at once but one could circumenvent the issue by calling refresh if the month was changed... |
@elsesiy When refreshing a month has little overhead that's fine, but sometimes it might not be a good idea to refresh it every time the month is changed. |
@danielbmarques In general I'd agree with you, it was just a proposal for a quick fix, since I don't known when I'll have the time to add the desired functionality ;) Yup, async would be way better, even though it's debatable how useful a calendar without the annotations is in the first place.. |
Ok, then. Thanks again. I'll try to help as much as I can. :) |
Close. This "sort of works". So if my calendar uses shouldDisplayOnDayView to show if a calendar entry exists in my DB, new "events" are added just fine. However if I delete an event from the DB and then call refreshPresentedMonth, it does not clear the existing dayview even though i return false for the non db entries. |
@justdan0227 I assume that you're not directly writing the database instead you might use a List or an Array as a temp storage. After removing the database entry, are you also refreshing the array/list? I'm doing the exact same thing in my app and it works flawlessly.. |
Uggg.. how embarrassing! Yep didn't clear out the array when I read back from the DB! Thanks. One more question but I'll pose in another issue. Thanks! |
@justdan0227 You're welcome! |
@elsesiy Now I actually tried calling refresh when a month is changed and the dotViews still aren't refreshed for the month right after and right before. :/ That's because on This makes the dot markers nearly useless, I can never be sure if they're shown correctly, so they just can't be trusted. The current function does this: for weekV in presentedMonthView.weekViews {
for dayView in weekV.dayViews {
// …
}
} I tried changing it to: for view in calendarView.subviews {
if let dayView = view as? DayView {
// …
}
} But it doesn't work. Toggling the presented date always refreshes the whole thing, I think it's because of this: monthViews[previous]?.removeFromSuperview()
monthViews[following]?.removeFromSuperview()
insertMonthView(getPreviousMonth(date), withIdentifier: previous)
insertMonthView(getFollowingMonth(date), withIdentifier: following) But I couldn't figure out how to do just that to refresh the dot markers, and I'm not sure if it's the best way to accomplish that. Any suggestions? In the meanwhile, I think this issue should be reopened. |
@danielbmarques man! you find so many errors. I wish i had someone like you to take a quick look at my stuff on github >_< |
@patchthecode Haha, I'm even feeling a little bad about it. I'm too much of a perfectionist. |
I have the same issue: the dot markers for previous and next month are not shown correctly. Anyway awesome library guys, I am still learning but so far the Demo project helps a lot! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Thank you for your contributions. |
This issue has been automatically closed because it has been inactive for 45 days. |
this issue was fixed? |
How do you get the calendar to refresh when we've update the Array backing events / dots?
The text was updated successfully, but these errors were encountered: