Thank you for publishing this widget. It loads much faster than the iOS6 UIDatePicker.
I believe there is a bug as described in the heading:
I believe it tries to scroll the day to 31 which is 1 more than the number of items in the day scrollview when the scrollToItemAtIndexPath is invoked.
In this part of setDate:
NSInteger currentDayIndex = [self.scrollerDay currentSelectedIndexPath].row;
if (dateComponents.day != currentDayIndex) {
[self.scrollerDay scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:dateComponents.day-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredVertically animated:animated];
}
I believe a fix is to add a line to the if section for month above like this:
NSInteger currentMonthIndex = [self.scrollerMonth currentSelectedIndexPath].row;
if (dateComponents.month != currentMonthIndex) {
[self.scrollerMonth scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:dateComponents.month-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredVertically animated:animated];
Thank you for publishing this widget. It loads much faster than the iOS6 UIDatePicker.
I believe there is a bug as described in the heading: I believe it tries to scroll the day to 31 which is 1 more than the number of items in the day scrollview when the scrollToItemAtIndexPath is invoked.
In this part of setDate:
NSInteger currentDayIndex = [self.scrollerDay currentSelectedIndexPath].row; if (dateComponents.day != currentDayIndex) { [self.scrollerDay scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:dateComponents.day-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredVertically animated:animated]; }
I believe a fix is to add a line to the if section for month above like this:
NSInteger currentMonthIndex = [self.scrollerMonth currentSelectedIndexPath].row; if (dateComponents.month != currentMonthIndex) { [self.scrollerMonth scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:dateComponents.month-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredVertically animated:animated];
} Regards
ghr1234