Categories
Development iOS Work Note

Work Note: Loading View Controllers from a Storyboard

When I need to load a view controller from a Storyboard I like to create an extension to the view controller’s class and add a class function to it that does the work. It keeps things looking clean in the code where you use it.

I’m not sure if this is smart or dumb. I’m sure very smart people will let me know. Here’s an example.

Here’s how you’d use it in your code.

By Rob Fahrni

Husband / Father / Developer