How to get something to run under one Storyboard?

I have four Storyboards that use the same ViewControllers or same code. However, I want one thing to run only on one of the storyboards. That was to turn a label's background gray. I thought I could do this by just having the label on that storyboard connected to the code only, but it didn't work because it gave me this error when I ran a different storyboard.

Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

I am thinking about solving it with if statement, but I don't know how to target a specific storyboard in code. If there is another way to solve my problem, I am fine with that option, but I would like to know if it's possible to target a certain storyboard in code. I have to code it gray to keep all the gray colored objects the same shade.

Please can someone help me?
I think of a solution which is a bit of a hack, but hope that can help.
  • create 2 label objects in all storyboards

  • hide one and show other depending on storyboard

  • in ViewController, create 2 IBOutlets ; one will be grayed, the other with another color

  • Have code so that when you change one label, the other is updated accordingly

I just create a label in each storyboard. Then I made them hidden in IB, and then I connected them to the original label's @IBOutlet. That solved the problem, so I used part of your solution. I still want to know if it's possible code the title of the storyBoard because I will need app to change different storyboard based on the device size that the person is running the app on.
So the solution I proposed worked.
You should mark the answer as correct to close the thread.
And start a new thread with the new question (to avoid having threads with ever continuing questions).


if it's possible code the title of the storyBoard

In this new thread, could you explain exactly what you want to do ? What are the present titles of the storyboards ?
How to get something to run under one Storyboard?
 
 
Q