SwiftyWalkthrough is a library for creating great walkthrough experiences in your apps, written in Swift.

Overview

SwiftyWalkthrough

Platform Language License CocoaPods Carthage Compatible

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.

Features

  • Add walkthroughs to your app with little effort: you don't need to change anything in your view hierarchy.
  • SwiftyWalkthrough is great for onboarding, walkthroughs, tutorials, etc.
  • Control with precision which views are accessible to the user in a given time.
  • Take users through a series of steps, even across multiple screens.
  • Is simple!

Preview

SwiftyWalkthrough provides you with a framework to build your walkthrough experience, giving you full control over what you want to achieve. The following examples were built using SwiftyWalkthrough:

SwiftyWalkthrough demo

MyChoicePad demo

Usage

SwiftyWalkthrough works by adding an overlay on top of your screen, blocking the access to your views. You can then control which views should be made accessible and when.

Initialize a walkthrough or attach to an existing one

import SwiftyWalkthrough

if let _ = walkthroughView {
	// Attached to existing walkthrough
} else {
   let myCustomWalkthrough = CustomWalkthroughView()
   startWalkthrough(myCustomWalkthrough)
   // Walkthrough initialized
}

Check if there is an ongoing walkthrough

Sometimes it is useful to know if there is an ongoing walkthrough (i.e. to adjust the logic on the view controllers). In that situation you can make use of the property ongoingWalkthrough.

@IBAction func switchValueChanged(sender: UISwitch) {
    customWalkthroughView?.removeAllHoles()
    customWalkthroughView?.helpLabel.hidden = true
	
    NSUserDefaults.standardUserDefaults().setBool(true, forKey: "settingsWalkthroughComplete")
	
    if ongoingWalkthrough {
        navigationController?.popToRootViewControllerAnimated(true)
    }
}

Cut holes on the overlay for the views you want to expose

@IBOutlet weak var nameField: UITextField!
@IBOutlet weak var surnameField: UITextField!
@IBOutlet weak var addressField: UITextField!

override func viewDidAppear(animated: Bool) {
	super.viewDidAppear(animated)
	walkthroughView?.cutHolesForViews([nameField]) // start by only allowing the interaction with nameField
}

cutHolesForViews will only look into your views' frames to cut the holes in the overlay. If you want to add some extra padding or define a corner radius, use cutHolesForViewDescriptors like this:

let descriptors = [
	ViewDescriptor(view: showProfileButton, extraPaddingX: 20, extraPaddingY: 10, cornerRadius: 10)
]

walkthroughView?.cutHolesForViewDescriptors(descriptors)

Remove the holes

walkthroughView?.removeAllHoles()

Close the walkthrough when it is finished

finishWalkthrough()

Customization

By default, SwiftyWalkthrough only provides the mechanism to block the access to your views and cut holes to access them, it's up to you to customize it to suit your needs. You can do it by subclassing WalkthroughView and start the walkthrough with your custom walkthrough view. You can find more about this on the example provided with the library.

import UIKit
import SwiftyWalkthrough

class CustomWalkthroughView: WalkthroughView {
    // customize it
}

let myCustomWalkthrough = CustomWalkthroughView()
startWalkthrough(myCustomWalkthrough)

To specify the overlay's dim color at any time you just need to set the property dimColor:

walkthroughView?.dimColor = UIColor.redColor().colorWithAlphaComponent(0.7).CGColor

WalkthroughViewDelegate

If for some reason you need to be notified right before the interaction with an exposed view, you can provide an implementation for the willInteractWithView method:

// MARK: - WalkthroughViewDelegate
    
func willInteractWithView(view: UIView) {
    print("Will interact with view \(view)")
}

Note: Keep in mind that willInteractWithView may be invoked multiple times, depending on the view hierarchy, as it relies on UIView's hitTest method. From the UIView Class Reference:

This method traverses the view hierarchy by calling the pointInside:withEvent: method of each subview to determine which subview should receive a touch event. If pointInside:withEvent: returns true, then the subview’s hierarchy is similarly traversed until the frontmost view containing the specified point is found. If a view does not contain the point, its branch of the view hierarchy is ignored. You rarely need to call this method yourself, but you might override it to hide touch events from subviews.

This method ignores view objects that are hidden, that have disabled user interactions, or have an alpha level less than 0.01. This method does not take the view’s content into account when determining a hit. Thus, a view can still be returned even if the specified point is in a transparent portion of that view’s content.

Points that lie outside the receiver’s bounds are never reported as hits, even if they actually lie within one of the receiver’s subviews. This can occur if the current view’s clipsToBounds property is set to false and the affected subview extends beyond the view’s bounds.

Requirements

  • iOS 9.0+
  • Xcode 10.2.1 / Swift 5

Instalation

CocoaPods

platform :ios, '9.0'
use_frameworks!

pod 'SwiftyWalkthrough'

Carthage

github "ruipfcosta/SwiftyWalkthrough"

Credits

Owned and maintained by Rui Costa (@ruipfcosta).

Thanks to Andrew Jackman (@andrew_jackman).

Contributing

Bug reports and pull requests are welcome.

License

SwiftyWalkthrough is released under the MIT license. See LICENSE for details.

Comments
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • Support to be able to set padding for each side individually

    Support to be able to set padding for each side individually

    Hello,

    I changed to be able to create padding for each side individually, I took care not to affect what was done previously, so I created a new init using UIEdgeInsets, and I passed the old init to a convenience init not to impact what is already using it.

    opened by rafaelbletro 0
  • Issue with Swift package manager

    Issue with Swift package manager

    It says the following when trying a branch "the manifest is missing a Swift tools version specification; consider prepending to the manifest '// swift-tools-version:5.4.0' to specify the current Swift toolchain version as the lowest Swift version supported by the project; if such a specification already exists, consider moving it to the top of the manifest, or prepending it with '//' to help Swift Package Manager find it in https://github.com/ruipfcosta/SwiftyWalkthrough"

    And when trying newest version on master "https://github.com/ruipfcosta/SwiftyWalkthrough has no Package.swift manifest for version 0.0.3 in https://github.com/ruipfcosta/SwiftyWalkthrough"

    opened by DavidDHansson 1
  • Segmentation Fault 11 using XCode 12.4 in willInteractWithView

    Segmentation Fault 11 using XCode 12.4 in willInteractWithView

    Hi 👋

    When building our project with XCode 12.4, a segmentation fault 11 occurs with the following stack trace

    3.	While looking for 'willInteractWithView:'4.	While ...in 'UIViewController' (in module 'UIKit')
    5.	[redacted]dlvqeumreafwivaaazjbchvrmbad/Build/Products/Debug-iphonesimulator/SwiftyWalkthrough/SwiftyWalkthrough.framework/Headers/SwiftyWalkthrough-Swift.h:216:1: importing 'WalkthroughViewDelegate::willInteractWithView:'
    0  swift                    0x0000000113edd615 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
    1  swift                    0x0000000113edc615 llvm::sys::RunSignalHandlers() + 85
    2  swift                    0x0000000113eddbcf SignalHandler(int) + 111
    3  libsystem_platform.dylib 0x00007fff6cff75fd _sigtramp + 29
    4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603338687482400
    5  swift                    0x0000000110a4bf41 (anonymous namespace)::SwiftDeclConverter::VisitObjCMethodDecl(clang::ObjCMethodDecl const*) + 321
    6  swift                    0x0000000110a3497d swift::ClangImporter::Implementation::importDeclAndCacheImpl(clang::NamedDecl const*, swift::importer::ImportNameVersion, bool, bool) + 1469
    7  swift                    0x0000000110a1ea3c swift::ClangImporter::loadObjCMethods(swift::ClassDecl*, swift::ObjCSelector, bool, unsigned int, llvm::TinyPtrVector<swift::AbstractFunctionDecl*>&) + 284
    8  swift                    0x0000000110b8919d swift::ASTContext::loadObjCMethods(swift::ClassDecl*, swift::ObjCSelector, bool, unsigned int, llvm::TinyPtrVector<swift::AbstractFunctionDecl*>&) + 301
    9  swift                    0x0000000110d5bc64 swift::ClassDecl::lookupDirect(swift::ObjCSelector, bool) + 180
    10 swift                    0x0000000110923776 lookupObjCMethodInClass(swift::ClassDecl*, swift::ObjCSelector, bool, bool, swift::SourceManager&, bool) + 54
    11 swift                    0x0000000110923180 swift::diagnoseUnintendedObjCMethodOverrides(swift::SourceFile&) + 944
    12 swift                    0x0000000110a0518a swift::performWholeModuleTypeChecking(swift::SourceFile&) + 250
    13 swift                    0x000000010fb7d0ad swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 8237
    14 swift                    0x000000010fa3d771 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6833
    15 swift                    0x000000010f9c1c27 main + 1255
    16 libdyld.dylib            0x00007fff6cdfecc9 start + 1
    17 libdyld.dylib            0x00000000000001fe start + 18446603338689549622
    

    It seems that the ff offending code inWalkthroughView can be rewritten while Apple fixes this compiler issue

    @objc public protocol WalkthroughViewDelegate {
        @objc optional func willInteractWithView(_ view: UIView)
    }
    

    Thanks!

    Environment: Xcode 12.4 MacOS Catalina 10.15.5

    opened by jazminebarroga 0
  • Carthage cannot build with swift 5

    Carthage cannot build with swift 5

    Since there is no release for swift 5, we can't simply use github "ruipfcosta/SwiftyWalkthrough" in the Cartfile. I made a repository here that has a swift 5 release - if you need to install with carthage, use the line:

    github "Innoviox/SwiftyWalkthrough"
    
    opened by Innoviox 0
  • Can't build using carthage

    Can't build using carthage

    I wish to this as a framework used for my project. However, when I use "carthage update", it gives me "Task failed with exit code 65:"

    opened by trialabc 2
Owner
Rui Costa
Rui Costa
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
Awesome tool for create tutorial walkthrough or coach tour

AwesomeSpotlightView is a nice and simple library for iOS written on Swift 5. It's highly customizable and easy-to-use tool. Works perfectly for tutor

Alexander Shoshiashvili 309 Jan 5, 2023
A swifty iOS framework that allows developers to create beautiful onboarding experiences.

SwiftyOnboard is being sponsored by the following tool; please help to support us by taking a look and signing up to a free trial SwiftyOnboard A simp

Juan Pablo Fernandez 1.2k Jan 2, 2023
An animated popover that pops out a given frame, great for subtle UI tips and onboarding.

Animated popover that pops out of a frame. You can specify the direction of the popover and the arrow that points to its origin. Color, border radius

Andrea Mazzini 3k Jan 8, 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
Onboarding - Completed project for creating Onboarding screens in SwiftUI

Onboarding Completed project for creating Onboarding screens in SwiftUI.

Khawlah Bawazir 0 Jan 13, 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
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
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
WVWalkthroughView is an objective C based utility to highlight certain parts for iOS apps.

WVWalkthroughView A simple utility written in Objective C to help developers walk a user through their app. It allows a message to be displayed, a par

Praagya Joshi 29 Mar 25, 2021
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
BWWalkthrough is a simple library that helps you build custom walkthroughs for your iOS App

What is BWWalkthrough? BWWalkthrough (BWWT) is a class that helps you create Walkthroughs for your iOS Apps. It differs from other similar classes in

Yari @bitwaker 2.8k Jan 4, 2023
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
Configurable animated onboarding screen written programmatically in Swift for UIKit

Configurable animated onboarding screen written programmatically in Swift for UIKit – inspired by many Apple-designed user interfaces in iOS – with Insignia as an example.

Lukman “Luke” Aščić 370 Dec 27, 2022
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
Create walkthroughs and guided tours (coach marks) in a simple way, with Swift.

Add customizable coach marks into your iOS project. Available for both iPhone and iPad. ⚠️ Instructions 2.0.1 brings a couple of breaking changes, ple

Frédéric Maquin 4.9k Jan 3, 2023
A Swift Recreation of Attach-Detach, with some configurable options

Attach-Detach-Sw A Swift Recreation of Attach-Detach, with some configurable options Usage To use, you'll need to specify if you are attaching or deta

Serena 1 Dec 24, 2021
Fully customisable tooltip view in Swift for iOS.

Description EasyTipView is a fully customizable tooltip view written in Swift that can be used as a call to action or informative tip. Contents Featur

Teo 2.9k Dec 27, 2022