I wondered what happens when a view is not present in a specific size class in a storyboard because I want to mimic this behavior in code.

I've created a test project and added two labels to the storyboard scene. labelOne is in the size classes Any-Any. labelTwo is only in the size class Regular-Compact.

To see what's going on I added outlets and the following print commands in viewDidLoad:

print("(labelOne.hidden) (labelOne.alpha) (labelOne.superview)")
print("(labelTwo.hidden) (labelTwo.alpha) (labelTwo.superview)")

The debug output is:

false 1.0 Optional(<UIView: 0x796e3740; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0x796e3910>>)
false 1.0 nil

This means, the labelTwo isn't shown when running for example on iPhone 4s because it is not added to the view. But the label is not nil even though it's a weak reference. I assume the reason behind that is that the storyboard holds a reference to the label.

I will try to mimic this behavior when creating code that uses size classes.