-
Notifications
You must be signed in to change notification settings - Fork 813
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
Missing delegate call. #96
Comments
This is odd. It should be called. I just tested Can you show me the one line of code you are using to scrollToDate? Also, when you scroll, is there a visual scrolling animation? |
@IBAction func nextMonthButtonTapped(sender: UIButton) {
calendarView?.scrollToNextSegment(true, animateScroll: true, completionHandler: nil)
}
func setupCalendar() {
formatter.dateFormat = "yyyy MM dd"
testCalendar.timeZone = NSTimeZone(abbreviation: "GMT")!
calendarView?.delegate = self
calendarView?.dataSource = self
calendarView?.registerCellViewXib(fileName: "DateCalendarCell")
calendarView?.direction = .Horizontal
calendarView?.cellInset = CGPoint(x: 0, y: 0)
calendarView?.allowsMultipleSelection = false
calendarView?.bufferTop = 0
calendarView?.bufferBottom = 0
calendarView?.firstDayOfWeek = .Sunday
calendarView?.scrollEnabled = true
calendarView?.pagingEnabled = true
calendarView?.itemSize = nil
calendarView?.cellSnapsToEdge = true
calendarView?.reloadData()
let currentDate = calendarView?.currentCalendarDateSegment() ?? (startDate:NSDate(), endDate: NSDate())
self.setupViewsOfCalendar(currentDate.startDate, endDate: currentDate.endDate)
} The scroll is animating when user scrolls manually or taps the button. The delegate is called when user scrolls manually but not when taps the button. Also on the sample project the scroll buttons are not working. |
wow.. that bug was introduced in last update. |
Ok bug has been fixed. Just doing some testing. |
Hey, I have pushed a fix to master branch. Are you able to test it? |
Btw, you can reduce your code to the following. Because in what you had previously, some are already the default. calendarView?.delegate = self
calendarView?.dataSource = self
calendarView?.registerCellViewXib(fileName: "DateCalendarCell")
calendarView?.cellInset = CGPoint(x: 0, y: 0)
calendarView?.reloadData() |
@patchthecode Its working fine now. Thanks for the quick fix. The reason the for the default properties being left on the setup method is that we can quickly tinker the calendar since the app is still in rapid development. Te code will be cleaned up after we get a final design submit ;). Thanks again for the awesome job! |
Got you. And Thanks :) And since its working again, i'll release the official version this evening. |
Hi. You are missing a delegate call on this function.
On line 251 you are currently setting the
but the delegate is never actually called. This cause programmatically scrolling date not allowing UI update.
I can throw a PR if that will make the fix faster.
Thanks for the awesome work done so far.
The text was updated successfully, but these errors were encountered: