Skip to content

more simple #4

@butcheryl

Description

@butcheryl

I have an idea:

// swift 3.0

public protocol StoryboardInstantiable { }

extension StoryboardInstantiable where Self: UIViewController {
    public static func create(of storyboard: Storyboard) -> Self {
        return UIStoryboard(storyboard: storyboard).instantiateViewController()
    }
}

extension UIViewController: StoryboardInstantiable { }

let vc = HomeViewController.create(of: .Home)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions