RVCalendarWeekView icon indicating copy to clipboard operation
RVCalendarWeekView copied to clipboard

How to scroll to current day?

Open danielrosero opened this issue 8 years ago • 1 comments

Hey, first of all, thanks for this component, it have been really useful.

I'm having this issue where after adding events, the weekview scrolls to the day with the oldest event.

It's there a way I can scroll back to the current day, in a programmatically way?

I tried calling:

 [self.weekView.weekFlowLayout scrollCollectionViewToClosetSectionToTime:[NSDate date] animated:NO];
 [self.decoratedWeekView.weekFlowLayout scrollCollectionViewToClosetSectionToTime:[NSDate date] animated:NO];

but its not working for me.

Thanks

danielrosero avatar Feb 06 '17 20:02 danielrosero

This should work, when are you calling it? are you doing it in the main thread?

There are all these methods

- (void)scrollCollectionViewToClosetSectionToCurrentTimeAnimated:(BOOL)animated;
- (void)scrollCollectionViewToClosetSectionToTime:(NSDate*)time animated:(BOOL)animated;
- (void)scrollCollectionViewToCurrentTime:(BOOL)animated;

You can use the last one if you want it to scroll to today

BadChoice avatar Feb 07 '17 09:02 BadChoice