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

Infinite Scroll / Only 1 (or 2) VC? #4

Open
stuffmc opened this issue Feb 14, 2013 · 0 comments
Open

Infinite Scroll / Only 1 (or 2) VC? #4

stuffmc opened this issue Feb 14, 2013 · 0 comments

Comments

@stuffmc
Copy link
Contributor

stuffmc commented Feb 14, 2013

There are a lot of places where you have Asserts to check that the current VC is not the same as the previous. Is there a reason? I'm in the situation where I want to show the same "data" over and over if there's only one. If I create a new VC everytime, it means I enter 3 times in my viewDidLoad. Same goes with only 2 records, I'll enter twice in the "next" and "previous" which would be the same. To schematize:

| A | A | A | — will enter 3 times in viewDidLoad for A if I want to comply to the NSAsserts
| A | B | A | — will enter twice for B.

I've tried ignoring (commenting) those Asserts, but then I have a blank page instead of the actual first VC. I can swipe to the second though.

What I did is

- (UIViewController *)pageViewController:(UIPageViewController *)pvc viewControllerBeforeViewController:(DataViewController *)vc
{
    if (self.modelController.pageData.count == 1) {
        return vc;
    }
...

My guess is that it's if I do so, the VC gets "moved" to the left every time, so it doesn't appear in the first place. Maybe I could also have my viewDidLoad code to be only started when the view is actually shown — which is not viewDid/WillAppear since that gets triggered at the beginning.

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

1 participant