guard let firstDay = [LambdaSchoolDays]().first

Table of Content

The first day

The first day was quite exciting! The only issue I had was that the lecture lasted a bit long. To be fair, they decided to make a few changes to the curriculum and this is the largest iOS cohort they’ve had so far. I still had a lot of fun and learned about storyboard references!

Storyboard reference

A storyboard reference is where you design your interface in different storyboard files, but then create segues to view controllers in other storyboards. This is particularly useful for larger projects as Interface Builder isn’t exactly known for its efficiency and stability, especially when dealing with larger files. It ended up being much simpler than I had anticipated.

Code Example

  1. Start by creating a new storyboard (I’m just calling mine Storyboard2.storyboard for this demo) and either creating or copying an existing view controller to it.
    1. storyboard
    2. storyboard2
  2. It is crucial that you set the initial view controller setting on the second storyboard
    • initial vc
  3. In the main storyboard, add a Storyboard Reference object
    • drag out
  4. With the reference selected, you can choose which storyboard you wish to reference
    • set reference
  5. Finally, treat the storyboard reference as if it’s any other view controller in your storyboard!
  6. And here’s the finished product (I skipped showing how to embed in a nav controller, btw)

Demo Project Link

If you’d like to see the demo project for yourself, you can get it here.

Leave a Reply

Your email address will not be published. Required fields are marked *