Latest 2.0.0
Homepage https://github.com/lionheart/WelcomeViewController
License Apache 2.0
Platforms ios 11.0
Dependencies SuperLayout, LionheartExtensions
Frameworks UIKit
Authors

WelcomeViewController
WelcomeViewController

A welcome view in the style of Apple’s built-in apps.

CI Status
Version
License
Platform
Swift

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

WelcomeViewController

Usage

Create an enum with all of the features you’d like to summarize:

enum WelcomeItem {
    case library
    case watchNow
    case store
}

Make the enum conform to WelcomeCardProvider.

extension WelcomeItem: WelcomeCardProvider {
    var title: String {
        switch self {
        case .library: return "Library"
        case .watchNow: return "Watch Now"
        case .store: return "Store"
        }
    }

    var description: String {
        switch self {
        case .library: return "Find your purchases and rentals in one convenient place."
        case .watchNow: return "Start watching the TV shows and mvoies you love from all your supported apps."
        case .store: return "Get supported apps, discover new movie releases, and find popular TV shows."
        }
    }

    var imageName: String? {
        switch self {
        case .library: return "Categories"
        case .watchNow: return "Preview"
        case .store: return "Check"
        }
    }

    var color: UIColor? {
        return UIColor(.RGB(37, 185, 255))
    }
}

Lastly, instantiate WelcomeViewController:

let controller = WelcomeViewController<WelcomeItem>(header: "Welcome to the TV app.", buttonText: "Continue", callouts: [.library, .watchNow, .store], delegate: nil)

To attach an action when someone taps the button, set the delegate to an object conforming to WelcomeViewControllerDelegate.

extension MyViewController: WelcomeViewControllerDelegate {
    func welcomeViewControllerButtonDidTouchUpInside(_ sender: Any) {
        dismiss(animated: true)
    }
}

Installation

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

pod 'WelcomeViewController'

Author

Dan Loewenherz

License

WelcomeViewController is available under the Apache 2.0 license. See the LICENSE file for more info.


Latest podspec

{
    "name": "WelcomeViewController",
    "version": "2.0.0",
    "summary": "A welcome view to quickly introduce users to your app.",
    "description": "A welcome view that lets you quickly introduce users to your app.",
    "homepage": "https://github.com/lionheart/WelcomeViewController",
    "license": {
        "type": "Apache 2.0",
        "file": "LICENSE"
    },
    "authors": {
        "Dan Loewenherz": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lionheart/WelcomeViewController.git",
        "tag": "2.0.0"
    },
    "social_media_url": "https://twitter.com/lionheartsw",
    "platforms": {
        "ios": "11.0"
    },
    "source_files": [
        "WelcomeViewController/Classes/**/*",
        "WelcomeViewController/Protocols/**/*"
    ],
    "frameworks": "UIKit",
    "dependencies": {
        "SuperLayout": [
            "~> 2.0"
        ],
        "LionheartExtensions": [
            "~> 5.0"
        ]
    },
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This