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

Storyboard example #31

Closed
ghost opened this issue Feb 5, 2015 · 6 comments
Closed

Storyboard example #31

ghost opened this issue Feb 5, 2015 · 6 comments

Comments

@ghost
Copy link

ghost commented Feb 5, 2015

would you mind to add a Storyboard example. That would be great! Thanks in advance!

@mamaral
Copy link
Owner

mamaral commented Feb 9, 2015

What exactly do you mean? Building an OnboardingContentViewController with a storyboard, or having the root view of the project be from a storyboard?

@Kurry
Copy link

Kurry commented Feb 21, 2015

I think he means the root view of the project be from a storyboard, and how to subclass OnboardingViewController to create your own onboarding experience. The cocoapods version, seems very out of sync with the current example, and so I understand his frustration.

@Kurry
Copy link

Kurry commented Feb 21, 2015

@vivanda Something like this will work.

#import "OnboardingViewController.h"
@interface GKOnboardingViewController : OnboardingViewController
@end
#import "GKOnboardingViewController.h"
#import "OnboardingContentViewController.h"

@interface GKOnboardingViewController ()
@end

@implementation GKOnboardingViewController

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithBackgroundImage:nil contents:nil];
    if (self) {
        self.iconSize = 160;
        self.fontName = @"HelveticaNeue-Thin";
        self.shouldMaskBackground = NO;
        self.shouldBlurBackground = NO;
        OnboardingContentViewController *firstPage = [[OnboardingContentViewController alloc] initWithTitle:@"Welcome" body:@"This is a demo." image:nil buttonText:@"Enable Locational Services" action:nil];
        OnboardingContentViewController *secondPage = [[OnboardingContentViewController alloc] initWithTitle:@"Relax" body:@"Grab a nice beverage, sit back, and enjoy the experience." image:nil buttonText:nil action:nil];
        OnboardingContentViewController *thirdPage = [[OnboardingContentViewController alloc] initWithTitle:@"Rock Out" body:@"Import your favorite tunes and jam out while you browse." image:nil buttonText:nil action:nil];
        OnboardingContentViewController *fourthPage = [[OnboardingContentViewController alloc] initWithTitle:@"Experiment" body:@"Try new things, explore different combinations, and see what you come up with!" image:nil buttonText:@"Let's Get Started" action:nil];
        _backgroundImage = [UIImage imageNamed:@"Street"];
        _viewControllers = @[firstPage, secondPage, thirdPage, fourthPage];
    }
    return self;
}
@end

@mamaral
Copy link
Owner

mamaral commented Feb 22, 2015

@Kurry thanks for the feedback. I updated the version and pushed to the Cocoapods trunk, so everything should be up-to-date now.

@Kurry
Copy link

Kurry commented Feb 22, 2015

@mamaral Thanks. I forgot to say thanks for creating this project. It's pretty great, so good that I'm using it in one of my personal projects now.

@mamaral
Copy link
Owner

mamaral commented Feb 22, 2015

No problem! Glad to get something out there that helps.

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