Skip to content
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

How to scroll to current day? #27

Open
danielrosero opened this issue Feb 6, 2017 · 1 comment
Open

How to scroll to current day? #27

danielrosero opened this issue Feb 6, 2017 · 1 comment

Comments

@danielrosero
Copy link

danielrosero commented Feb 6, 2017

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

@BadChoice
Copy link
Owner

BadChoice commented Feb 7, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants