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.

https://gist.github.com/Fahrni/537fd42c38882a007a1c506369f3f2c6

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

https://gist.github.com/Fahrni/fb03913774f026787892cd2d42ab741b