mamaral / Onboard

An iOS framework to easily create a beautiful and engaging onboarding experience with only a few lines of code.
MIT License
6.46k stars 765 forks source link

Trouble with Storyboard Segues #49

Closed batnom closed 9 years ago

batnom commented 9 years ago

Hi there,

I have an instance of a OnboardingViewController named HomeViewController on my Storyboard and it is set to be the 'Initial View Controller', followed the example here: https://github.com/mamaral/Onboard/issues/31#issuecomment-75390136

It's showing the Onboarding flip-book, but when I try to use a Segue after they hit the last button it chucks up the error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<HomeViewController: 0x7fc8cbdaaf70>) has no segue with identifier 'GO''

This is how the page is created:

OnboardingContentViewController *firstPage = [[OnboardingContentViewController alloc] initWithTitle:@"Welcome" body:@"This is a demo." image:[UIImage imageNamed:@"fb_big"] buttonText:@"Enable Locational Services" action:^{
            NSLog(@"yay");
            [self performSegueWithIdentifier:@"GO" sender:self];
        }];

I've played around with calling it from a __weak typeof(self) weakSelf = self;, or using self.parentViewController, and a bunch of other ways with no luck.

Is there a way to do this? I would much rather do it this way than the appDelegate way. It all seems to be working except for pushing to the next view controller.

Many thanks

mamaral commented 9 years ago

Have you set the segue identifier for "Go" in interface builder?

batnom commented 9 years ago

Yes its a Push segue with the identifier "GO"

mamaral commented 9 years ago

hmm perhaps that's the problem. I'll have to look again at the example you posted a link to, but whenever I've implemented this the transition from the onboarding to the app itself has never been a push, it's always been a direct swap of the root view controller of the app. I don't mess around with storyboards and segues often, so I don't know how much I would be able to help without maybe a sample app to run?

mamaral commented 9 years ago

If you could get me a sample project I could tinker with, I'll try and see what's going on. In the meantime - I'm going to close this until there's an update.