Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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