You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I have only tested this with the weekly view, but when I check for calendar.currentSection in the didScrollToDateSegmentWith delegate method, it skips the multiples of 10th (id: 9) section. So if I print these values and start scrolling from the first section, I get the following:
0
1
2
3
4
5
6
7
8
10
11
12
13
14
15
16
17
18
20
As you can see, it misses the 9th and 19th section. This is not a major issue, but I found it while debugging calendarView.scrollToDate function when it's invoked with triggerScrollToDateDelegate: true, animateScroll: true. The problem is that for certain sections, the triggerScrollToDateDelegate triggers before the animation completes.
I narrowed it down to this function:
func calendarOffsetIsAlreadyAtScrollPosition(forOffset offset:CGPoint)->Bool{varretval= false
// If the scroll is set to animate, and the target content// offset is already on the screen, then the// didFinishScrollingAnimation// delegate will not get called. Once animation is on let's// force a scroll so the delegate MUST get caalledlettheOffset= scrollDirection ==.horizontal ? offset.x : offset.y
letdivValue= scrollDirection ==.horizontal ? frame.width : frame.height
letsectionForOffset=Int(theOffset / divValue)letcalendarCurrentOffset= scrollDirection ==.horizontal ? contentOffset.x : contentOffset.y
if calendarCurrentOffset == theOffset || (scrollingMode.pagingIsEnabled() && (sectionForOffset ==currentSection())){
retval = true
}return retval
}
The currentSection() call in the above function returns the wrong section in some cases and hence it satisfies the condition which invokes the didScrollToDateSegmentWith prematurely.
I couldn't find a way to fix it but I am hoping someone here can point me to the right direction. Thank you!
The text was updated successfully, but these errors were encountered:
For now, I have exposed a new function in the delegate scrollDidEndScrollingAnimation which fires after the didScrollToDateSegmentWith. This is a small hack to go around the issue but it seems to be working fine for me.
Version: 8.0.3
So, I have only tested this with the weekly view, but when I check for
calendar.currentSection
in thedidScrollToDateSegmentWith
delegate method, it skips the multiples of 10th (id: 9) section. So if I print these values and start scrolling from the first section, I get the following:As you can see, it misses the 9th and 19th section. This is not a major issue, but I found it while debugging
calendarView.scrollToDate
function when it's invoked withtriggerScrollToDateDelegate: true, animateScroll: true
. The problem is that for certain sections, thetriggerScrollToDateDelegate
triggers before the animation completes.I narrowed it down to this function:
The
currentSection()
call in the above function returns the wrong section in some cases and hence it satisfies the condition which invokes thedidScrollToDateSegmentWith
prematurely.I couldn't find a way to fix it but I am hoping someone here can point me to the right direction. Thank you!
The text was updated successfully, but these errors were encountered: