Refactoring From a Huge Storyboard to Multiple Smaller and More Manageable Objects

Dealing with storyboard references

Davide Fin
Jan 20 · 7 min read
Photo by Caspar Camille Rubin on Unsplash

The Day Has Come


Multiple Storyboards

let storyboard = UIStoryboard(name: “SecondStoryboard”, bundle: nil)let secondVC = storyboard.instantiateViewController(identifier:”SecondViewController”)show(secondVC, sender: self)

A Completely Interface Builder Approach


A Manual Programmatic Approach

let storyboard = UIStoryboard(name: "SecondStoryboard", bundle: nil)let secondVC = storyboard.instantiateViewController(identifier: "SecondViewController")show(secondVC, sender: self)
self.performSegue(withIdentifier: "goThere", sender: self)

Routable


Recent Updates Introduced by Xcode 11 and iOS 13

SegueAction

Custom initializers


Conclusion


Complete Code for Routable Component

Better Programming

Advice for programmers.

Davide Fin

Written by

Senior developer at OverApp — https://overapp.com

Better Programming

Advice for programmers.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade