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
Set dotMarkers from JSON result #80
Comments
I tried this approach after my data was loaded, but it still does not reload the dots on the days that should have them.
|
ok, I found a solution that worked for me, maybe it will for others. As mentioned I am using protocol and delegate to load my data from a server but you can use any function that gets called in the viewDidLoad. This change does not technically reload the calendar but it does prevent the calendar from loading before getting the data. |
Hello @wstudios, @matlamenace, @avicooper1, Thank you for reporting the issue. I'll add support for reloading CVCalendar components in the upcoming maintenance. Regards, |
Hi @mozharovsky! For this issue I found a solution that reload calendarView at run time. public func reloadMonthView(selectedDate: NSDate) {
let newController: ContentController
contentController.updateHeight(contentController.presentedMonthView.potentialSize.height, animated: true)
newController = MonthContentViewController(calendarView: self, frame: bounds, presentedDate: selectedDate)
newController.updateFrames(bounds)
newController.scrollView.alpha = 0
addSubview(newController.scrollView)
UIView.animateWithDuration(0.5, delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: {
self.contentController.scrollView.alpha = 0
newController.scrollView.alpha = 1
}) { _ in
self.contentController.scrollView.removeAllSubviews()
self.contentController.scrollView.removeFromSuperview()
self.contentController = newController
}
} Hope this helps! :) |
Mozharovsky, has this issue been fixed? GioSkellington, I tried your method but it did not work. When I call this method and pass in the selectedDate, there was an error message which says "Cannot invoke 'reloadMonthView' with an argument list of type (NSDate)". |
GioSkellington, I managed now to call the function. However, the dotMarkers still do not update in the view. |
Hi GioSkellington, thanks very much for your solution. It works! |
hot to show dotmark on a particular date in cvcalendar |
Hi, I was wondering if anyone can help with this. I know how to get the json data which includes my dates . I have a delegate set in my controller that creates a model of the data and places it in an array. The problem I have is that the calendar gets finished long before the array is built so it remains a 0 count if I try to use inside the 'func dotMarker(shouldShowOnDayView dayView:'
Any help on getting the data before the calendar is drawn or adding the dotmarkers and refreshing would be great.
Thanks.
The text was updated successfully, but these errors were encountered: