BWWalkthrough is a simple library that helps you build custom walkthroughs for your iOS App

Overview


CocoaPods Carthage Compatible Platform Twitter

What is BWWalkthrough?

BWWalkthrough (BWWT) is a class that helps you create Walkthroughs for your iOS Apps. It differs from other similar classes in that there is no rigid template; BWWT is just a layer placed over your controllers that gives you complete freedom on the design of your views..

Preview

Video preview Here A dedicated tutorial is available on ThinkAndBuild

The class comes with a set of pre-built animations that are automatically applied to the subviews of each page. This set can be easily substituted with your custom animations.

BWWT is essentially defined by 2 classes: BWWalkthroughViewController is the Master (or Container). It shows the walkthrough and contains UI elements that are shared among all the Pages (like UIButtons and UIPageControl).

BWWalkthroughPageViewController defines every single Page that is going to be displayed with the walkthrough inside the Master.

What it's not?

BWWT is not a copy-paste-and-it-just-works class and it is not a fixed walkthrough template. If you need a simple no-configuration walkthrough, BWWT is not the right choice.

Installation

Note: There is a known issue with IBOutlets and Carthage that prevents Outlets from working correctly. I see something similar reported for other projects too. My suggestion is to follow the manual installation instructions, as it is just matter of drag and drop 2 files in your project. I know you cannot update the library automatically going that route... but IBOutlets are needed for a project like BWWalkthrough.

With CocoaPods

BWWalkthrough is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "BWWalkthrough"

With Carthage

Include this line into your Cartfile:

github "ariok/BWWalkthrough"

Run carthage update to build the framework and drag the built BWWalkthrough.framework into your Xcode project.

With Swift Package Manager

// swift-tools-version:5.0	
import PackageDescription
	
let package = Package(
name: "YourTestProject",
platforms: [
    .iOS(.v10),
],
dependencies: [
    .package(url: "https://github.com/ariok/BWWalkthrough/.git", from: "4.0.1")
],
targets: [
    .target(name: "YourTestProject", dependencies: ["BWWalkthrough"])
]
)

And then import wherever needed: import BWWalkthrough

Adding it to an existent iOS Project via Swift Package Manager

  1. Using Xcode 11 go to File > Swift Packages > Add Package Dependency
  2. Paste the project URL: https://github.com/ariok/BWWalkthrough
  3. Click on next and select the project target

If you have doubts, please, check the following links:

How to use

Creating Swift Packages

After successfully retrieved the package and added it to your project, just import BWWalkthrough and you can get the full benefits of it.

Manually

Include the BWWalkthrough/BWWalkthroughViewController.swift and the BWWalkthrough/BWWalkthroughPageViewController.swift files into your project.

How to use it?

Define the Master

Add a new controller to the Storyboard and set its class as BWWalkthroughViewController. This is the Master controller where every page will be attached.

Here you can add all the elements that have to be visible in all the Pages.

There are 4 prebuilt IBOutlets that you can attach to your elements to obtain some standard behaviours: UIPageControl (pageControl), UIButton to close/skip the walkthrough (closeButton) and UIButtons to navigate to the next and the previous page (nextButton, prevButton). You can take advantage of these IBOutlets just creating your UI elements and connecting them with the outlets of the Master controller.

Define the Pages

Add a new controller to the Storyboard and set it has BWWalkthroughPageViewController. Define your views as you prefer.

Attach Pages to the Master

Here is an example that shows how to create a walkthrough reading data from a dedicated Storyboard:

// Get view controllers and build the walkthrough
let stb = UIStoryboard(name: "Walkthrough", bundle: nil)
let walkthrough = stb.instantiateViewControllerWithIdentifier(“Master”) as BWWalkthroughViewController
let page_one = stb.instantiateViewControllerWithIdentifier(“page1”) as UIViewController
let page_two = stb.instantiateViewControllerWithIdentifier(“page2”) as UIViewController
let page_three = stb.instantiateViewControllerWithIdentifier(“page3”) as UIViewController

// Attach the pages to the master
walkthrough.delegate = self
walkthrough.add(viewController:page_one)
walkthrough.add(viewController:page_two)
walkthrough.add(viewController:page_three)

Prebuilt Animations

You can add animations without writing a line of code. You just implement a new Page with its subviews and set an animation style using the runtime argument {Key: animationType, type: String} via IB. The BWWalkthrough animates your views depending on the selected animation style.

At the moment (WIP!) the possible value for animationsType are: Linear, Curve, Zoom and InOut The speed of the animation on the X and Y axes must be modified using the runtime argument {key: speed type:CGPoint}, while the runtime argument {key: speedVariance type: CGPoint} adds a speed variation to the the subviews of the page depending on the hierarchy position.

Example Let’s say that we have defined these runtime arguments for one of the Pages:

  • animationType: "Linear"
  • speed: {0,1}
  • speedVariance: {0,2}

The subviews of the Page will perform a linear animation adding speed to the upfront elements depending on speedVariance. So if we have 3 subviews, the speed of each view will be:

  • view 0 {0,1+2}
  • view 1 {0,1+2+2}
  • view 2 {0,1+2+2+2}

creating the infamous parallax effect.

Exclude Views from automatic animations

You might need to avoid animations for some specific subviews.To stop those views to be part of the automatic BWWalkthrough animations you can just specify a list of views’ tags that you don’t want to animate. The Inspectable property staticTags (available from version ~> 0.6) accepts a String where you can list these tags separated by comma (“1,3,9”). The views indicated by those tags are now excluded from the automatic animations.

Custom Animations

Each page of the walkthrough receives information about its normalized offset position implementing the protocol BWWalkthroughPage, so you can extend the prebuilt animations adding your super-custom-shiny-woah™ animations depending on this value (here is a simple example)

func walkthroughDidScroll(position: CGFloat, offset: CGFloat) {
    var tr = CATransform3DIdentity
    tr.m34 = -1/500.0
    titleLabel?.layer.transform = CATransform3DRotate(tr, CGFloat(M_PI)*2 * (1.0 - offset), 1, 1, 1)
}

Delegate

The BWWalkthroughViewControllerDelegate protocol defines some useful methods that you can implement to get more control over the Walkthrough flow.

@objc protocol BWWalkthroughViewControllerDelegate {
        @objc optional func walkthroughCloseButtonPressed()
        @objc optional func walkthroughNextButtonPressed()
        @objc optional func walkthroughPrevButtonPressed()
        @objc optional func walkthroughPageDidChange(pageNumber:Int)
}
Comments
  • RTL Support

    RTL Support

    When choosing a RTL language in "Localization native development region" the FW behave odd and jumpy! Beside, order of the pages reversed (not excepted) and scroll direction not changes to RTL.

    For testing, just set Localization native development region to some RTL language like "ar" or "fa".

    enhancement 
    opened by MojtabaHs 9
  • Problem with 'override init()' function

    Problem with 'override init()' function

    Hi there,

    On Xcode 6.3 there seems to be a bunch of issues, most of which are fixable with the self-help fixit suggestions, but the one which isn't so obvious is the following method..

    override init() { super.init() scrollview = UIScrollView() controllers = Array()

    }

    which throws the error -> 'Initializer does not override a designated initializer from its superclass'

    Not sure how to effectively resolve. Any suggestions? Thanks!

    opened by simonarcher 8
  • Problem code signing in Xcode 8.1?

    Problem code signing in Xcode 8.1?

    I just updated to Xcode 8.1 and now when I try to build BWWalkthrough with Carthage I get this:

    *** Building scheme "BWWalkthrough" in BWWalkthrough.xcworkspace
    ** BUILD FAILED **
    
    
    The following build commands failed:
        CodeSign ~/Library/Developer/Xcode/DerivedData/BWWalkthrough-ecklotinmmriuvgawsznbpuibagi/Build/Products/Release-iphonesimulator/BWWalkthrough.bundle
    (1 failure)
    A shell task (/usr/bin/xcrun xcodebuild -workspace .../Carthage/Checkouts/BWWalkthrough/Example/BWWalkthrough.xcworkspace -scheme BWWalkthrough -configuration Release -sdk iphonesimulator -destination "platform=iOS Simulator,id=026C2315-1D1A-4AF1-8B32-73EA3E1273BE" -destination-timeout 3 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
    ** BUILD FAILED **
    
    
    The following build commands failed:
        CodeSign ~/Library/Developer/Xcode/DerivedData/BWWalkthrough-ecklotinmmriuvgawsznbpuibagi/Build/Products/Release-iphonesimulator/BWWalkthrough.bundle
    (1 failure)
    

    Any ideas?

    Edit: I ran carthage update with the --verbose flag and this is what it says right before the error:

    CodeSign ~/Library/Developer/Xcode/DerivedData/BWWalkthrough-ecklotinmmriuvgawsznbpuibagi/Build/Products/Release-iphonesimulator/BWWalkthrough.bundle
        cd .../Carthage/Checkouts/BWWalkthrough/Example/Pods
        export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
        export PATH="..."
    
    Signing Identity:     "-"
    
        /usr/bin/codesign --force --sign - --timestamp=none ~/Library/Developer/Xcode/DerivedData/BWWalkthrough-ecklotinmmriuvgawsznbpuibagi/Build/Products/Release-iphonesimulator/BWWalkthrough.bundle
    ~/Library/Developer/Xcode/DerivedData/BWWalkthrough-ecklotinmmriuvgawsznbpuibagi/Build/Products/Release-iphonesimulator/BWWalkthrough.bundle: bundle format unrecognized, invalid, or unsuitable
    Command /usr/bin/codesign failed with exit code 1
    

    Apparently people are having similar issues when the package has a "Resources" directory… it doesn't seem like you do, though, but maybe there's something similar?

    help wanted 
    opened by dbmrq 7
  • Moving views

    Moving views

    For whatever reason, the scroll view is allowing my pages to move in any direction. I've tried setting alwaysBounceVertical to false, and I've tried to remove all bounce from the scrollview to no avail.

    Any ideas?

    EDIT FWIW, my master is presented within a navigation controller. Although the navigation bar should show up, it's not. It seems like the tolerance for the "bounce" is about the same height as a navigation bar.

    opened by justinmakaila 7
  • Scrollview can be drag all around

    Scrollview can be drag all around

    Hey,

    I'm trying to fix a problem with my scrollview. I want the scrollview move only right and left(without the option to be drag up or down).

    How can i fix it?

    help wanted 
    opened by RonGafni 6
  • NSLayoutContraint crash in BWWalkthroughViewController

    NSLayoutContraint crash in BWWalkthroughViewController

    Xcode 8 with Swift 3.0

    On line 229, scrollview.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[previousView]-0-[view]", options:[], metrics: nil, views: ["previousView":previousView,"view":vc.view]))

    throws

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue nsli_superitem]: unrecognized selector sent to instance 0x60000024d7a0

    I apologize that I'm not too familiar with creating constraints in code, therefore can't offer anything more than pointing it out.

    opened by cqin5 6
  • how to programmatically close the walkthrough?

    how to programmatically close the walkthrough?

    I am trying to close the walkthrough programmatically after user logs in. I implemented delegate in my class like so:

    var walkthroughDelegate: BWWalkthroughViewControllerDelegate?

    and called the close button like so:

    self.walkthroughDelegate?.walkthroughCloseButtonPressed!()

    But the walkthrough is not closing. There is no error either.

    opened by talvinder 6
  • WIP: Added dynamic resizing to support orientation changes

    WIP: Added dynamic resizing to support orientation changes

    I added Auto Layout constraints to added pages that are dynamically updated when the BWWalkthroughViewController's view is resized, particularly when the orientation changes.

    invalid 
    opened by nilsvu 5
  • Could not cast to BWWalkthroughViewController

    Could not cast to BWWalkthroughViewController

    Could not cast value of type 'UIViewController' (0x1094ff5e0) to 'BWWalkthrough.BWWalkthroughViewController' (0x10734ab50).

    I have made sure I imported BWWalkthrough and declared the delegate. But I keep getting this error on line:

    walkthrough = stb.instantiateViewControllerWithIdentifier("container") as! BWWalkthroughViewController

    I have ensured that the it is in fact a BWWalkthroughViewController in interface as well.

    EDIT: I have noticed that this error is thrown when I use CocoaPods to install BWWalkthrough - not when I include the files manually....

    opened by croossin 5
  • Problems with orientation and modally presented views

    Problems with orientation and modally presented views

    First of all, thanks for your great work! I have an issue when it comes to displaying BWWalkthroughViewController on the iPad. When in landscape the constraints are all wrong and I have not found a solution for it. It is also displayed wrong if the BWWalkthroughViewController is presented as PageSheet or FormSheet. Any ideas? Regards, Erik

    bug 
    opened by fishfisher 5
  • Add a scheme for carthage

    Add a scheme for carthage

    I made a scheme for carthage. It is because I wanted to use the carthage.

    Make Cartfile

    github "kokoron/BWWalkthrough" "e43b377a59112edda07b0ff1e696679be986501b"
    

    And run carthage

    $ carthage update
    
    opened by kokoron 5
  • Fix issue with pushing on navigation controller

    Fix issue with pushing on navigation controller

    This PR contains a fix for an issue I discovered that occurs when instead of presenting a BWWalkthroughViewController - pushing with a UINavigationController.

    opened by brunomunizaf 0
  • Problem with init() when subclassing BWWalkthrough

    Problem with init() when subclassing BWWalkthrough

    While trying to implement the cocoa pod, BWWalkthrough, into my current project programmatically, I ran into a problem with the init functions/inheritance.

    I tried to subclass BWWalkThroughViewController in my own class GetStartedViewController where I define buttons and pagecontrollers.

    Here is the code from BWWalkThroughViewController which is a subclass of UIViewController:

    class BWWalkThroughViewController: UIViewController {
        required public init?(coder aDecoder: NSCoder) {
            // Setup the scrollview
            scrollview.showsHorizontalScrollIndicator = false
            scrollview.showsVerticalScrollIndicator = false
            scrollview.isPagingEnabled = true
            super.init(coder: aDecoder)
        }
    
        override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
            super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
        }
    }
    
    

    But when I try and subclass BWWalkthroughViewController in my own class I get errors saying "Ambiguous reference to member 'init(coder:)'" when calling super.init(nibName, bundle) and another error (Initializer does not override a designated initializer from its superclass) when I try to override the init(nibname, bundle):

    import BWWalkthrough
    
    class GetStartedViewController: BWWalkthroughViewController  {
    
    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    public init(){
        super.init(nibName: nil, bundle: nil) <== ERROR (Ambiguous reference to member 'init(coder:)')
    }
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) <== ERROR (Initializer does not override a designated initializer from its superclass) {
        super.init(nibName: nil, bundle: nil) <== ERROR (Ambiguous reference to member 'init(coder:)')
    }
    }
    

    I've tried different variations of containing just the public init or just the override init and not both, so I included both to show the error.

    Even when I use autocomplete to call super.init, all that shows up is the function with parameters of nscoder rather than with nibName and bundle.

    Can someone please help me understand why this error is happening and how to fix it? I don't understand why I can't call super.init(nibName, bundle) or override the function.

    Also, if anyone else has experience implementing BWWalkthrough programmatically and/or subclassing BWWalkthroughViewController without this init bug, any help would be appreciated :)

    help wanted 
    opened by wonathanjong 1
  • Properly forward appearance callbacks

    Properly forward appearance callbacks

    Previously all child view controller had viewWillAppear called as soon as the walkthrough page appeared.

    This commit fixes this by disabling the automatic forwarding of appearance information to all child views, and instead handles it manually both for the programatic case (calling gotoPage) and for the manual case where the scrolls the scroll view.

    Both appearance and disappearance are forwarded correctly in my testing and there were no run-time issues of unbalanced appearance calls.

    opened by nighthawk 1
  • Memory problem with larger number of views

    Memory problem with larger number of views

    I have used the BBWalkthrough to make an app but have more than 15 views it scrolls through. As the views that are not removed when they are not shown the memory is over 100mb used. Can you purge the views that are shown or being animated (views -1 and +1). Great work by the way!

    enhancement 
    opened by sashalondon 1
Owner
Yari @bitwaker
Playing with code at @BlackRobotGames. Author of 'Learning iOS UI Development' http://bit.ly/1SDEXPP.
Yari @bitwaker
Presentation helps you to make tutorials, release notes and animated pages.

Presentation helps you to make tutorials, release notes and animated pages.

HyperRedink 3k Jan 5, 2023
A simple and attractive AlertView to onboard your users in your amazing world.

AlertOnboarding A simple and attractive AlertView to onboard your users in your amazing world. PRESENTATION This AlertOnboarding was inspired by this

Boisney Philippe 832 Jan 8, 2023
A super-charged version of MYIntroductionView for building custom app introductions and tutorials.

MYBlurIntroductionView #####NOTICE: As of February 4th, Apple has begun to ban new app submissions using the common blurring method (UIToolbar hack) f

Matthew York 1.5k Dec 23, 2022
SwiftyWalkthrough is a library for creating great walkthrough experiences in your apps, written in Swift.

SwiftyWalkthrough is a library for creating great walkthrough experiences in your apps, written in Swift. You can use the library to allow users to navigate and explore your app, step by step, in a predefined way controlled by you.

Rui Costa 370 Nov 24, 2022
Simple coach mark library written in Swift

Minamo Simple coach mark library written in Swift Usage Initialize let rippeleView = RippleView() rippeleView.tintColor = UIColor(red: 0.3, green: 0.7

yukiasai 248 Nov 24, 2022
A simple keyframe-based animation framework for iOS, written in Swift. Perfect for scrolling app intros.

RazzleDazzle is a simple AutoLayout-friendly keyframe animation framework for iOS, written in Swift. Perfect for scrolling app intros. RazzleDazzle gr

IFTTT 3.4k Jan 1, 2023
OnboardKit - Customizable user onboarding for your UIKit app in Swift

OnboardKit Customizable user onboarding for your UIKit app in Swift Requirements Swift 5.0 Xcode 10 iOS 11.0+ Installation Carthage github "NikolaKire

Nikola Kirev 470 Dec 23, 2022
Showcase your awesome new app features 📱

WhatsNewKit enables you to easily showcase your awesome new app features. It's designed from the ground up to be fully customized to your needs. Featu

Sven Tiigi 2.8k Jan 3, 2023
A simple keyframe-based animation framework for UIKit. Perfect for scrolling app intros.

Jazz Hands is a simple keyframe-based animation framework for UIKit. Animations can be controlled via gestures, scroll views, KVO, or ReactiveCocoa. J

IFTTT 6.4k Dec 28, 2022
✨ An elegant way to guide your beloved users in iOS apps - Material Showcase.

Material Showcase for iOS An elegant and beautiful tap showcase view for iOS apps based on Material Design Guidelines. Requirement iOS 10.0+ Swift 4.2

Aromajoin 349 Dec 5, 2022
An iOS framework to easily create simple animated walkthrough, written in Swift.

Intro Overview An iOS framework to easily create simple animated walkthrough, written in Swift. Requirements iOS8 Installation with CocoaPods Intro is

Nurdaulet Bolatov 33 Oct 1, 2021
iOS library Paper Onboarding is a material design UI slider written on Swift.

iOS library Paper Onboarding is a material design UI slider written on Swift. We specialize in the designing and coding of custom UI

Ramotion 3.2k Jan 5, 2023
Swift based simple information view with pointed arrow.

InfoView View to show small text information blocks with arrow pointed to another view.In most cases it will be a button that was pressed. Example To

Anatoliy Voropay 60 Feb 4, 2022
SwiftUI library for a walkthrough or onboarding flow with tap actions

Concentric Onboarding iOS library for a walkthrough or onboarding flow with tap actions written with SwiftUI We are a development agency building phen

Exyte 955 Jan 4, 2023
VideoSplashKit - UIViewController library for creating easy intro pages with background videos

VideoSplashKit - Video based UIViewController Introduction Requires iOS 8 or later and Xcode 6.1+ Swift support uses dynamic frameworks and is therefo

Sahin Boydas 1.2k Dec 28, 2022
ColorMix-by-IUKit - colorMix app by Intro to app development in Swift

colorMix-by-IUKit colorMix app by "Intro to app development in Swift" In this ap

null 0 Feb 11, 2022
A nice tutorial like the one introduced in the Path 3.X App

ICETutorial Welcome to ICETutorial. This small project is an implementation of the newly tutorial introduced by the Path 3.X app. Very simple and effi

Icepat 798 Jun 30, 2022
Show overlay and info on app components

SwiftyOverlay App Intro / Instruction component to show data over app UI at run time! Easy to use, Animated and Customizable. Supported Components are

Saeid 80 Aug 29, 2022
SuggestionsKit is a framework for iOS that was created in order to provide developers with the opportunity to educate users on various features of applications.

SuggestionsKit is a framework for iOS that was created in order to provide developers with the opportunity to educate users

Ilya 63 Nov 30, 2022