GithubHelp home page GithubHelp logo

mamaral / onboard Goto Github PK

View Code? Open in Web Editor NEW
6.5K 6.5K 766.0 78.16 MB

An iOS framework to easily create a beautiful and engaging onboarding experience with only a few lines of code.

License: MIT License

Objective-C 98.47% Ruby 1.53%

onboard's People

Contributors

andepopande avatar anuragalla avatar bitdeli-chef avatar diogoguimaraes avatar dlackty avatar emaloney avatar estebansotoara avatar huguesbr avatar isena avatar kaphacius avatar lfarah avatar madhavajay avatar mamaral avatar motoshima1150 avatar phatmann avatar sirdharma avatar westleylashley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onboard's Issues

How do I change the background on each page

Hi , Great way to implement on boarding for swift, I wonder where, if its posible of course, I can change the background image of each page like the Gemr app. Im just trying to get the same effect as Gemr with diferents images and a button but Im stuck. Thanks in advance for your great work.

Swift

Any plans to create a swift version?

Get the action buttons work in Swift

would you mind to enhance the Swift example so it shows the full implementation of the capabilities. Newbies like me struggle with stuff such as the action button, which does not currently work. Thx!

For example: how can I get tp my initial rootViewController created in my Storboard?

let thirdPage: OnboardingContentViewController = OnboardingContentViewController(title: "second Page", body: "on second page...", image: UIImage(named:
"yellow"), buttonText: "Let's Get Started") {

            //let mainStoryboard: UIStoryboard = UIStoryboard(name: "loginVC", bundle: nil)
            let loginView: VCLogin = VCLogin(nibName: "loginVC", bundle: nil)
            self.window?.makeKeyAndVisible()
            self.window?.rootViewController?.presentViewController(loginView, animated: true,   completion: nil)      
    }

the above code does not work

BTW: great work!

Cannot import headers in Swift Bridging Header

I have added Onboard using CocoaPods, and then I tried to import the headers to my bridging header in swift, but it says that the 2 headers cannot be found. I can see them there so where might be the problem?

Landscape Mode?

Any way to implement Landscape mode?

Alternatively, how would I "wrap it in a subclassed UINavigationController that only supports portrait"

Auto-Layout issues

Hello, so I got everything working on my app. I thought I had everything with Auto-layout done but unfrotunately it is not properly scaled on some devices (iPad, iPhone 5s etc..)

I added this code :

//******************

    imageView.contentMode = .ScaleAspectFit
    imageView.clipsToBounds = true
    imageView.setTranslatesAutoresizingMaskIntoConstraints(false)
    self.view.addSubview(imageView)
    self.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .Bottom, relatedBy: .Equal, toItem: self.view, attribute: .Bottom, multiplier: 1, constant: 0))
    self.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .CenterX, relatedBy: .Equal, toItem: self.view, attribute: .CenterX, multiplier: 1, constant: 0))

    imageView.addConstraint(NSLayoutConstraint(item: imageView, attribute: .Width, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: 300))

    imageView.addConstraint(NSLayoutConstraint(item: imageView, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: 900))

   imageView.frame = CGRect ()

    // ******************

and also edited some of the Constants for the padding. But unfortunately it hasn't worked.

Do you have any methods of configuring auto-layout through code?

Swift files removed?

Hello! A few days ago I decided to use your beautiful library, and downloaded the swift files, but now they are missing from the repo. Did you remove them?

White background color not working

Hello, I am using the swift version. I am setting the background color

onboardingVC.view.backgroundColor = UIColor.whiteColor()

however it shows grey instead of white. All other color works except for the white. thoughts?

Jump to certain page ( in Swift ) ?

This isn't an issue but wasn't sure where else to put it.
Is there a way to jump to a specific page?

I have tried manipulating the underlying scroll view but with no success. Essentially I want to reset back to the first page when the user returns (without recreating the Onboard)

Thanks

This is great! Any chance we can disable swiping?

This is great. You've done a nice job! 👍 Any chance we could customize it so that we can disable the swiping feature. I would love to be able to programmatically call the next view (Perfect for scenarios where you want a user to perform a certain task, to proceed move to the next step).

Landscape

Landscape support would greatly increase its usefulness

Calling the walkthrough pages from a button on a separate VC?

How would I call the walkthrough pages from a different VC? I have a settings page with a "tutorial" button. When the user clicks "tutorial", I want them to see the walkthrough pages.

I'm having trouble with showing the pages. I'm using this code, and some other similar ones:

//************
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewControllerWithIdentifier("OnboardingViewController") as! UIViewController
var initialViewController = storyboard.instantiateViewControllerWithIdentifier("OnboardingViewController") as! UIViewController

//*************

I'm getting an error stating: "Storyboard doesn't contain a view controller with identifier 'OnboardingViewController"

I've tried using: onboardingVC. onboardingContentViewController, and generateOnboardingViewController.

Is there an identifier associated with the VC?

Would you have any idea?

Add to an Storyboard

Hi Mike, here again my problem :) As I already mention in my email I can't really figure out, how to add this amazing project into mine. I´m using Storyboards and I would like to add my firstViewController after your "Skip" / "Lets Start" Buttons.... I saw in Code some hint, but for me it´s like a Wormhole (full of mysteries and questions) :)

Here your code:

- (void)setupNormalRootViewControllerAnimated:(BOOL)animated {
    // create whatever your root view controller is going to be, in this case just a simple view controller
    // wrapped in a navigation controller
    UIViewController *mainVC = [UIViewController new];
    mainVC.title = @"Main Application";

    // if we want to animate the transition, do it
    if (animated) {
        [UIView transitionWithView:self.window duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
            self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:mainVC];
        } completion:nil];
    }

    // otherwise just set the root view controller normally without animation
    else {
        self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:mainVC];
    }

I´ve added an new ViewController to the SB and tried to Link it to UIViewController *mainVC but it hasn't worked....
To understand how it could works, i also add an blank Storyboard to your project and I´ve tried to build it up with an new ViewController and so on, but without any results.

I would be very thankful for your help.
With best regards and happy holidays

Adam

Storyboard example

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

Hide page control on certain page

Is it possible to control the appearance for the page control per page? I want to hide it on the last page and show a button on the spot, but also allow users to scroll back.

Right implementation?

How this will be implemented;

  • First time launch (set bool, hasLaunched)
  • start onboarding
  • turn on locations (ask permission)
  • some login
  • dismiss onboarding

Using the app like normal..

My question is, with Storyboard I start the app with the view check "Initial View"

Font sizes not "sticking"

Hello.

I'm trying to get a tutorial working in Swift. I'm very close, however it does not seem to retain the global font name and size settings I'm providing. The default font and font size are what is being shown. In debugger I can see that the setters are being called in the OnboardingContentViewController classes, but it still isn't looking right and view debugger shows defaults.

Any ideas?

class func generateOnboardingViewController(completion: () -> ()) -> OnboardingViewController {     
        var pages = [OnboardingContentViewController]()

        pages.append(
            OnboardingContentViewController(
            title: "Welcome!",
            body: "test test test test",
            image: UIImage(named: "sj-logo"),
            buttonText: nil) {
        })

        pages.append(OnboardingContentViewController(
            title: "Page 2",
            body: "test test test test",
            image: UIImage(named:"onboarding_2"),
            buttonText: "OK - Let's Play") {
                NSUserDefaults.standardUserDefaults().setBool(true, forKey: self.kUserHasOnboarded)
                completion()
        })

        // Kill NUI style stuff here... this appears to be only way to do so...
        for vc: OnboardingContentViewController in pages {
            for view: UIView in vc.view.subviews as! [UIView] {
                view.nuiClass = "none"
            }
        }

        // Create the onboarding controller with the pages and return it.
        let onboardingVC: OnboardingViewController = OnboardingViewController(
            backgroundImage: UIImage(named: "Gradient"),
            contents: pages
        )

        onboardingVC.fontName = "AvenirNext-Regular"
        onboardingVC.shouldMaskBackground = false
        onboardingVC.titleTextColor = UIColor.whiteColor()
        onboardingVC.bodyTextColor = UIColor.whiteColor()
        onboardingVC.titleFontSize = 20
        onboardingVC.bodyFontSize = 13
        onboardingVC.underIconPadding = 10
        onboardingVC.underTitlePadding = 15
        onboardingVC.bottomPadding = 20

        return onboardingVC
    }

When I run Onboard, an error has occurred

The environment:iOS7.1+iphone4s
*** Assertion failure in -[_UIQueuingScrollView _replaceViews:updatingContents:adjustContentInsets:animated:], /SourceCache/UIKit/UIKit-2935.138/_UIQueuingScrollView.m:383
2015-06-08 18:00:08.856 Onboard[442:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: [views count] == 3'
*** First throw call stack:
(0x2d88cf83 0x3803dccf 0x2d88ce5d 0x2e23ad5b 0x3060ab99 0x3060da75 0x3060a1a9 0x300a9d59 0x2fd2762b 0x2fd22e3b 0x2fd22ccd 0x2fd226df 0x2fd224ef 0x2fd1c21d 0x2d858255 0x2d855bf9 0x2d855f3b 0x2d7c0ebf 0x2d7c0ca3 0x326c6663 0x3010d14d 0x996d1 0x3854aab7)
libc++abi.dylib: terminating with uncaught exception of type NSException。

Some helpful information online:
http://stackoverflow.com/questions/14220289/removing-a-view-controller-from-uipageviewcontroller
http://stackoverflow.com/questions/20004310/invalid-parameter-exception-thrown-by-uiqueuingscrollview

Customize page control and skip button

Hi,

I need to put an overlay on the bottom of the screen where the page control and skip button lie. Since my image screenshot is white and you can't clearly see the skip button or the page control.

I put an overlay view on top but then the skip button wasn't visible.

Is it possible to change the color/font of the skip button and change the color of the page control 'dots'?

Or can you tell me how I can do this?

Thanks,
Varun

ViewContoller init

Hi there - I have a silly question I think. I have a viewcontroller that I want to initialize the onboarding screens with. I can't figure out how to initialize the view from my own controller using swift. I see you have an Objc example, but I can't figure why I can't get it going in Swift. Thanks!!!

    override func viewDidLoad() {
        setup()

    }

    func setup(){
        // Generate the first page...
        let firstPage: OnboardingContentViewController = OnboardingContentViewController(title: "What A Beautiful Photo", body: "This city background image is so beautiful", image: UIImage(named:
            "blue"), buttonText: nil) {
                println("Do something here...");
        }

        // Generate the second page...

        let secondPage: OnboardingContentViewController = OnboardingContentViewController(title: "I'm So Sorry", body: "I can't get over the nice blurry background photo.", image: UIImage(named:
            "red"), buttonText: nil) {
                println("Do something else here...");
        }

        // Generate the third page, and when the user hits the button we want to handle that the onboarding
        // process has been completed.
        let thirdPage: OnboardingContentViewController = OnboardingContentViewController(title: "Seriously Though", body: "Kudos to the photographer.", image: UIImage(named:
            "yellow"), buttonText: nil) {
        }

        // Create the onboarding controller with the pages and return it.
        WelcomeViewController.onboardWithBackgroundImage(UIImage(named: "home"), contents: [firstPage, secondPage, thirdPage])
        //Customize Onboarding VC

        self.shouldMaskBackground = true
        self.shouldBlurBackground = true
        self.underIconPadding = 0
        self.topPadding = 100
        self.iconHeight = 0
        self.underPageControlPadding = 100

        // Create Buttons
        let viewWidth: CGFloat = CGRectGetWidth(self.view.frame)
        let viewHeight: CGFloat = CGRectGetHeight(self.view.frame)
        let horizontalCenter: CGFloat = viewWidth / 2
        let buttonOffset:CGFloat = 30
        let buttonWidth:CGFloat = 80
        let buttonHeight:CGFloat = 50

        var loginButton = UIButton(frame: CGRectMake(horizontalCenter - buttonWidth - buttonOffset, viewHeight-60, buttonWidth, buttonHeight))
        var registerButton = UIButton(frame: CGRectMake(horizontalCenter + buttonOffset, viewHeight-60, buttonWidth, buttonHeight))

        registerButton.setTitle("Register", forState: .Normal)
        registerButton.backgroundColor = UIColor.whiteColor()
        loginButton.backgroundColor = UIColor.greenColor()
        loginButton.setTitle("Login", forState: .Normal)
        self.view.addSubview(registerButton)
        self.view.addSubview(loginButton)
        self.viewControllers = [firstPage, secondPage, thirdPage]

    }

IconSize question

Hi

Thanks for sharing this great library.

How can I change the icon Width & Height? OnboardingContentViewController has a property iconSize but that sets both the width and height of the icon to be the same value I give iconSize. How do I add an icon and maintain it's dimensions ratio if its not a square?

Thanks
Varun

Different images on each walkthrough page?

How would I implement a different picture on each walkthrough page. so that when they scroll right or left, they see a different picture?

When I edit the image in the onBoardingViewController, it just changes the picture in the middle.

screen shot 2015-08-07 at 10 15 27 am

Maybe if I could just change the entire background image of each page?

Also, I'm using Swift.

Thanks

Just some warnings in regards to integer conversions.

You were using NSUInteger for the blur method and that resulted in a warning. Basically it was looking for an unsigned int. I changed it to unsigned int radius instead of NSUInteger * radius which removed the warning and didn't have any adverse affects.

Trouble with Storyboard Segues

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: #31 (comment)

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

Swift: Sometimes, the view controller is not rendered

I used Onboard a couple of times without worries. Today I ran into a very weird bug : a view is not rendered (it is blank, but if I click were the button is supposed to be, it starts working again).
If I allow swiping, it works. But not if I move to the next page programmatically.

I can't put the code (too big?) but it's pretty straightforward : I execute moveToNextPage() on each button action.

Thanks

Video background vs photo

Hey,

Great work with this library!

Is it possible to use a video as background instead of a photo?
Something like a video looping would be really cool with both mask + blur applied.

Implementing in Swift

Hello, is there a tutorial on how I could implement this with Swift?
Kinda new, but do I need to create New view controllers or PageViewControllers?

slide action in last view - new feature

first of all thanks for this excellent library.it certainly helped me a lot.
I think a great feature would be to be able to slide past the last page in order to skip or perform a custom action.
What do you think?

thanks for your time

Confused on Importing

I don't understand, how can I import this on a swift project? I installed it via cocoapods but I can't import it. Am I missing something?

Build script need to change?

0.00s$ xctool -project Objective-C/Onboard.xcodeproj -sdk iphonesimulator -scheme Onboard build
ERROR: Specified project doesn't exist: Objective-C/Onboard.xcodeproj
The command "xctool -project Objective-C/Onboard.xcodeproj -sdk iphonesimulator -scheme Onboard build" exited with 1.
0.00s$ xctool -project Swift/OnboardSwift.xcodeproj -sdk iphonesimulator -scheme OnboardSwift build
ERROR: Specified project doesn't exist: Swift/OnboardSwift.xcodeproj
The command "xctool -project Swift/OnboardSwift.xcodeproj -sdk iphonesimulator -scheme OnboardSwift build" exited with 1.

Should the path be Demo/Onboard.xcodeproj ?

custom view

is there any easy way to implement our own custom view and use that as one of the OnboardingContentViewController views?

thanks

Tapping on pages dots

There seems to be a little bug. Tapping on the page/ing dots actually works and changes the active dot. Not the page. It's a minor thing but it's happening.

Don't work onboard in my app

I'm wrote appDelegate.m like this.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{


    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"IPhone"    bundle: nil];
    SidebarViewController *rightMenu = (SidebarViewController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"sidebar"];
    [SlideNavigationController sharedInstance].rightMenu = rightMenu;

    // Creating a custom bar button for right menu
        UIButton *button  = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 22, 22)];
    [button setImage:[UIImage imageNamed:@"submenu"] forState:UIControlStateNormal];
    [button addTarget:[SlideNavigationController sharedInstance] action:@selector(toggleRightMenu) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    [SlideNavigationController sharedInstance].rightBarButtonItem = rightBarButtonItem;
        [SlideNavigationController sharedInstance].enableShadow = NO;



    //set white text color for status-bar
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 

    BOOL userHasOnboarded = [[NSUserDefaults standardUserDefaults] boolForKey:kUserHasOnboardedKey];

    if (userHasOnboarded) {
        [self setupNormalRootViewControllerAnimated:NO];
    } else {
        self.window.rootViewController = [self generateFirstDemoVC];
    }

    //set font and style for navigation bar
    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:38.0f/255.0f green:38.0f/255.0f blue:47.0f/255.0f alpha:1.0f]];
    [[UINavigationBar appearance] setTitleTextAttributes:@{
                                                           NSForegroundColorAttributeName: [UIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f],
                                                           NSFontAttributeName: [UIFont fontWithName:@"ProximaNova-Regular" size:15]
                                                           }];

    [Appirater appLaunched:YES];
    [Appirater setAppId:@"552035781"];
    [Appirater setDaysUntilPrompt:1];
    [Appirater setUsesUntilPrompt:10];
    [Appirater setSignificantEventsUntilPrompt:-1];
    [Appirater setTimeBeforeReminding:2];
    [Appirater setDebug:YES];

    return YES;
}

- (void)setupNormalRootViewControllerAnimated:(BOOL)animated {
    // create whatever your root view controller is going to be, in this case just a simple view controller
    // wrapped in a navigation controller
    NSString *lib = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSString *file = [lib stringByAppendingPathComponent:@"Metro0_1.sqlite"];
    if(![[NSFileManager defaultManager] fileExistsAtPath:file]) {

        id dbInBundle = [[NSBundle mainBundle] pathForResource:@"Metro0_1" ofType:@"sqlite"];

        [[NSFileManager defaultManager] createDirectoryAtPath:lib withIntermediateDirectories:YES attributes:nil error:nil];
        [[NSFileManager defaultManager] copyItemAtPath:dbInBundle toPath:file error:nil];
    }

    UINavigationController *navigationController =(UINavigationController *)self.window.rootViewController;
    MainViewController *controller = (MainViewController *)navigationController.topViewController;
    controller.managedObjectContext = self.managedObjectContext;
    // if we want to animate the transition, do it
    if (animated) {
        [UIView transitionWithView:self.window duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
            self.window.rootViewController = controller;
        } completion:nil];
    }

    // otherwise just set the root view controller normally without animation
    else {
        self.window.rootViewController = controller;
    }
}

- (void)handleOnboardingCompletion {
    // set that we have completed onboarding so we only do it once
    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:kUserHasOnboardedKey];

    // animate the transition to the main application
    [self setupNormalRootViewControllerAnimated:NO];
}

- (OnboardingViewController *)generateFirstDemoVC {
    OnboardingContentViewController *firstPage = [[OnboardingContentViewController alloc] initWithTitle:@"What A Beautiful Photo" body:@"This city background image is so beautiful." image:[UIImage imageNamed:@"blue"] buttonText:@"Enable Location Services" action:^{
        [[[UIAlertView alloc] initWithTitle:nil message:@"Here you can prompt users for various application permissions." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
    }];

    OnboardingContentViewController *secondPage = [[OnboardingContentViewController alloc] initWithTitle:@"I'm so sorry" body:@"I can't get over the nice blurry background photo." image:[UIImage imageNamed:@"red"] buttonText:@"Connect With Facebook" action:^{
        [[[UIAlertView alloc] initWithTitle:nil message:@"Prompt users to do other cool things on startup." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
    }];

    OnboardingContentViewController *thirdPage = [[OnboardingContentViewController alloc] initWithTitle:@"Seriously Though" body:@"Kudos to the photographer." image:[UIImage imageNamed:@"yellow"] buttonText:@"Get Started" action:^{
        [self handleOnboardingCompletion];
    }];

    OnboardingViewController *onboardingVC = [[OnboardingViewController alloc] initWithBackgroundImage:[UIImage imageNamed:@"street"] contents:@[firstPage, secondPage, thirdPage]];

    // If you want to allow skipping the onboarding process, enable skipping and set a block to be executed
    // when the user hits the skip button.
    onboardingVC.allowSkipping = YES;
    onboardingVC.skipHandler = ^{
        [self handleOnboardingCompletion];
    };

    return onboardingVC;
}

Onboard download, but then I tap skip button or "Get start" on last screen, Xcode throw exception and terminating my app

-[OnboardingViewController topViewController]: unrecognized selector sent to instance 0x16567d10

 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[OnboardingViewController topViewController]: unrecognized selector sent to instance 0x16567d10'

What's wrong with me?)

Using it with a TabbarController

This is normally my code in the AppDelegate, but if I put the code in the
setupNormalRootViewControllerAnimated

Like this:



- (void)setupNormalRootViewControllerAnimated:(BOOL)animated {
    // create whatever your root view controller is going to be, in this case just a simple view controller
    // wrapped in a navigation controller

    // if we want to animate the transition, do it
    if (animated) {
        [UIView transitionWithView:self.window duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{


            [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nav_ios7"] forBarMetrics:UIBarMetricsDefault];
            [[UIToolbar appearance] setBackgroundImage:[UIImage imageNamed:@"nav_ios7"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];

            [[UIApplication sharedApplication] setStatusBarStyle:(UIStatusBarStyleLightContent) animated:YES];

            [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
            [[UINavigationBar appearance] setBarTintColor: [UIColor whiteColor]];

            [[UITabBar appearance] setBarTintColor: [UIColor colorWithRed:0.851 green:0.702 blue:0.129 alpha:1.000]];


            [[UITabBar appearance] setTintColor:[UIColor whiteColor]];


            UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
            UITabBar *tabBar = tabBarController.tabBar;
            UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
            UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1];
            UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2];
            UITabBarItem *tabBarItem4 = [tabBar.items objectAtIndex:3];
            UITabBarItem *tabBarItem5 = [tabBar.items objectAtIndex:4];

            tabBarItem1.selectedImage = [[UIImage imageNamed:@"842-chat-bubbles-selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            tabBarItem1.image = [[UIImage imageNamed:@"842-chat-bubbles"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            //tabBarItem2.title = @"Kwèke";

            tabBarItem2.selectedImage = [[UIImage imageNamed:@"728-clock-selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            tabBarItem2.image = [[UIImage imageNamed:@"728-clock"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            //tabBarItem1.title = @"Wè?";

            tabBarItem3.selectedImage = [[UIImage imageNamed:@"799-beverage-selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            tabBarItem3.image = [[UIImage imageNamed:@"799-beverage"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            //tabBarItem3.title = @"Waor?";

            tabBarItem4.selectedImage = [[UIImage imageNamed:@"874-newspaper-selected.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            tabBarItem4.image = [[UIImage imageNamed:@"874-newspaper.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            //tabBarItem4.title = @"Nieuws";
            tabBarItem5.selectedImage = [[UIImage imageNamed:@"727-more-selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            tabBarItem5.image = [[UIImage imageNamed:@"727-more"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
            //tabBarItem5.title = @"Meer";


        } completion:nil];
    }

    // otherwise just set the root view controller normally without animation
    else {


        [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nav_ios7"] forBarMetrics:UIBarMetricsDefault];
        [[UIToolbar appearance] setBackgroundImage:[UIImage imageNamed:@"nav_ios7"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];

        [[UIApplication sharedApplication] setStatusBarStyle:(UIStatusBarStyleLightContent) animated:YES];

        [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
        [[UINavigationBar appearance] setBarTintColor: [UIColor whiteColor]];

        [[UITabBar appearance] setBarTintColor: [UIColor colorWithRed:0.851 green:0.702 blue:0.129 alpha:1.000]];


        [[UITabBar appearance] setTintColor:[UIColor whiteColor]];


        UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
        UITabBar *tabBar = tabBarController.tabBar;
        UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0];
        UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1];
        UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2];
        UITabBarItem *tabBarItem4 = [tabBar.items objectAtIndex:3];
        UITabBarItem *tabBarItem5 = [tabBar.items objectAtIndex:4];

        tabBarItem1.selectedImage = [[UIImage imageNamed:@"842-chat-bubbles-selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        tabBarItem1.image = [[UIImage imageNamed:@"842-chat-bubbles"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        //tabBarItem2.title = @"Kwèke";

        tabBarItem2.selectedImage = [[UIImage imageNamed:@"728-clock-selected"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        tabBarItem2.image = [[UIImage imageNamed:@"728-clock"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        //tabBarItem1.title = @"Wè?";

        tabBarItem3.selectedImage = [[UIImage imageNamed:@"799-beverage-selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        tabBarItem3.image = [[UIImage imageNamed:@"799-beverage"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        //tabBarItem3.title = @"Waor?";

        tabBarItem4.selectedImage = [[UIImage imageNamed:@"874-newspaper-selected.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        tabBarItem4.image = [[UIImage imageNamed:@"874-newspaper.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        //tabBarItem4.title = @"Nieuws";
        tabBarItem5.selectedImage = [[UIImage imageNamed:@"727-more-selected"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        tabBarItem5.image = [[UIImage imageNamed:@"727-more"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
        //tabBarItem5.title = @"Meer";




    }
}


I get an error thats not working with the tabbar in the OnBoard or a white screen ;-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.