Latest 1.0.0
Homepage https://github.com/Peterek/storyboard-instantiable
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors


CocoaPods


Carthage

Example

Conform to StoryboardInstantiable

import StoryboardInstantiable

class ChickenViewController: UIViewController {

    var chickenDependency: Chicken!
}

extension ChickenViewController: StoryboardInstantiable {

    typealias Dependencies = Chicken

    static var storyboardName: String { return "ChickenStoryboard" }

    static var storyboardIdentifier: String { return "chickenVC" }

    func setup(dependencies: Chicken) {
        self.chickenDependency = dependencies
    }

}

Then simply call instantiateFromStoryboardWith on viewController type

let chickenViewController = ChickenViewController.instantiateFromStoryboardWith(dependencies: Chicken())

Usage

Manual

  • Drag the file StoryboardInstantiable.swift into your application’s Xcode project.

CocoaPods

  • pod ‘StoryboardInstantiable’

Latest podspec

{
    "name": "StoryboardInstantiable",
    "version": "1.0.0",
    "summary": "A nicer way to instantiate controller from storyboard in Swift.",
    "homepage": "https://github.com/Peterek/storyboard-instantiable",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Piotr Wiu0119caszek": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/Peterek/storyboard-instantiable.git",
        "tag": "1.0.0",
        "submodules": true
    },
    "source_files": "Sources/**/*",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This