Code Monkey home page Code Monkey logo

lawalkthrough's Introduction

LAWalkthrough

LAWalkthrough is a view controller class for iOS designed to simplify the creation of the walkthrough design pattern. This code was inspired in April, 2013 by the screenshots displayed at http://www.mobile-patterns.com/walkthroughs by Mari Sheibley.

It is simple to use and requires very little code to implement a nice looking walkthrough. It uses UIPageControl and UIScrollView and is easy to subclass for customization.

How To Get Started

Example Usage

Display a walkthrough with text views and a background image

// Create the walkthrough view controller
LAWalkthroughViewController *walkthrough = LAWalkthroughViewController.new;
walkthrough.view.frame = self.view.frame;
walkthrough.backgroundImage = [UIImage imageNamed:@"tour-bg@2x"];

// Create pages of the walkthrough
[walkthrough addPageWithBody:@"Take a tour of this app."];
[walkthrough addPageWithBody:@"Thanks for taking this tour."];

// Use the default next button
walkthrough.nextButtonText = nil;

// Add the walkthrough view to your view controller's view
[self addChildViewController:walkthrough];
[self.view addSubview:walkthrough.view];

Screenshot from this example:
LAWalkthrough

Display a walkthrough with XIB views and a background image

// Create the walkthrough view controller
LAWalkthroughViewController *walkthrough = LAWalkthroughViewController.new;
walkthrough.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-50);
walkthrough.backgroundImage = [UIImage imageNamed:@"tour-bg1@2x"];

// Create pages of the walkthrough from XIBs
[walkthrough addPageWithNibName:@"TourView1" bundle:nil]; // no need for a view controller
[walkthrough addPageWithNibName:@"TourView2" bundle:nil]; // no need for a view controller
[walkthrough addPageWithNibName:@"TourView3" bundle:nil]; // no need for a view controller

// Use text for the next button
walkthrough.nextButtonText = @"Next >";

// Add the walkthrough view to your view controller's view
[self addChildViewController:walkthrough];
[self.view addSubview:walkthrough.view];

Screenshot from this example:
LAWalkthrough

Requirements

LAWalkthrough 1.0 and higher requires iOS 6.0 and above.

ARC

LAWalkthrough uses ARC as of its 1.0 release.

If you are using LAWalkthrough 1.0 in your non-arc project, you will need to set a -fobjc-arc compiler flag on all of the LAWalkthrough source files.

To set a compiler flag in Xcode, go to your active target and select the "Build Phases" tab. Now select all LAWalkthrough source files, press Enter, insert -fobjc-arc or -fno-objc-arc and then "Done" to enable or disable ARC for LAWalkthrough.

Credits

LAWalkthrough was created by Larry Aasen in the development of Konugo for iPhone.

Contact

Follow LAWalkthrough and Konugo on Twitter (@Konugo)

Creators

Larry Aasen
@larryaasen

License

LAWalkthrough is available under the MIT license. See the LICENSE file for more info.

lawalkthrough's People

Contributors

larryaasen avatar

Watchers

James Cloos avatar

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.