Coder Social home page Coder Social logo

surfboard's Introduction

Surfboard

Surfboard is a delightful onboarding library for iOS.

Screenshots

Intro Panels

Dependencies

Surfboard was developed with Xcode 5 and the iOS 7 SDK. It uses autolayout and UICollectionViewController, so although it hasn't been tested on iOS 6, you may entertain yourself by trying to run Surfboard on it.

Installing Surfboard

Add the contents of the SRFSurfboard project to your directory, or use Cocoapods:

pod 'Surfboard'

Import SRFSurfboard.h to get access to all of the great features of Surfboard.

Getting Started

When we talk about Surfboards, we talk about a set of panels. Each panel is a screenful of information, including some text, an image or screenshot, and optionally, a button.

Take a look at the Sample Data directory for an idea of what a sample JSON configuration looks like.

Showing a Surfboard

You can show a surfboard by using a segue, or by creating a an instance of SRFSurfboardViewController and passing it an array of some panels. You can also pass a path to a JSON file, which we'll discuss in just a second.

The two initializers for a surfboard:

//	One surfboard, the initWithPanels: way.

SRFSurfboardViewController *surfboard = [[SRFSurfboardViewController alloc] initWithPanels:anArrayOfPanels];

//	Another surfboard, the initWithPathToCofiguration way.

SRFSurfboardViewController *surfboard = [[SRFSurfboardViewController alloc] initWithPathToConfiguration:aPathToJSONFile];

Creating Panels

Panels can be created programatically, or using a JSON file. The JSON format is simple. There are four keys:

  1. text The text that appears at the top of the panel.
  2. image An image to show in the panel. The image is tinted to the tintColor of the surfboard.
  3. screen A screenshot to show in the panel. The screenshot is not tinted.
  4. button The title of a button to show at the bottom of the panel. This is optional.

Note that either the contents of the "image" or "screen" will be used, but not both. Supplying both results in undefined behavior.

Here's a sample panel:

{
	"text" : "Welcome to Surfboard.",
	"image" : "swipe"
}

You'd want to add an image to your bundle or asset catelog named "swipe.png" and Surfboard would display it.

License

SRFSurfboard is released under the MIT license. See LICENSE for more.

More Open Source

If you like SRFSurfboard, you may like some of my other projects on GitHub.

surfboard's People

Contributors

mosheberman avatar abrahamvegh avatar anatg avatar

Watchers

Chew Chit Siang avatar  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.