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

Is it possible to advance pages or "Jump to last" Page? #131

Open
younanjo opened this issue May 22, 2016 · 3 comments
Open

Is it possible to advance pages or "Jump to last" Page? #131

younanjo opened this issue May 22, 2016 · 3 comments
Labels

Comments

@younanjo
Copy link

Is there a jump to last page mechanism or advance by certain number of pages? I want to skip to last page of the Onboard pages when users taps Skip rather than dismissing the view. any ideas?

@mamaral
Copy link
Owner

mamaral commented May 23, 2016

There is a property called something like movesToNextPage if I recall correctly. There is no built in mechanism for moving to the last page directly though.

@opswhisperer
Copy link

The problem with the current implementation is that the completion handler and the move to next page happen simultaneously. It would be great if the movesToNextPage happened at the end of the completion handler.

For example, if I'm explaining the need for access to the users location, I want them to press continue, request authorization and then advance. Currently that authorization prompt will show up on top if the next screen.

@mamaral
Copy link
Owner

mamaral commented Jun 18, 2016

You could do something like the following to achieve what you're talking about @opswhisperer

OnboardingContentViewController *firstPage = [OnboardingContentViewController contentWithTitle:title body:body image:[UIImage imageNamed:@"blue"] buttonText:buttonText action:^{
        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"My Alert" message:@"Ask for something." preferredStyle:UIAlertControllerStyleAlert];
        UIAlertAction *firstAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
            [self.onboardingVC moveNextPage];
        }];
        UIAlertAction *secondAction = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleDefault handler:nil];

        [alert addAction:firstAction];
        [alert addAction:secondAction];

        [self.onboardingVC presentViewController:alert animated:YES completion:nil];
    }];

Tell your onboard view controller to move to the next page when the action you want to occur happens.

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

No branches or pull requests

3 participants