Skip to content

Add examples for testing both with and without storyboards to README #62

@theextremeprogrammer

Description

@theextremeprogrammer

Without a storyboard is easy - just initialize the view controller and be sure to load the view:

let viewController = ViewController()
viewController.loadViewControllerForUnitTest()

// expectations

With a storyboard, you just need to assign the view controller a Storyboard ID in the .storyboard file and load the storyboard first and then instantiate the VC from that storyboard:

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let viewController = storyboard.instantiateViewController(withIdentifier: "ViewController") as! ViewController

// expectations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions