After some months of not opening this project, when I opened it today, every new view I add to my ViewController’s interface in the corresponding Storyboard is not reflected. For instance, changing a button background does not reflect in the app at runtime.
Also, adding new views and referencing them through a @IBOutlet doesn’t work as well. I get a nil view reference on my viewDidLoad
. Weirdly enough, all the views I had before, and am accessing on the viewDidLoad are not nil. Only the new views I add have this problem.
I have tried clearing the DerivedData folder and simulator caches but I ran out of stuff to try out. Anyone else having this issue?
To sum it all, every change I do on the interface builder now is to being applied to my view.
I am running Xcode 12.5.
EDIT: I tried adding a UILabel programmatically and it works. So, this is something that is wrong with how the storyboard creates the view reference in the ViewController. I still need help tho.
3
Answers
I found the issue after some hours. What led to this was that somehow, when I localized the storyboard in the past, XCode created one storyboard per language instead of just creating 2 .string files for each language. So this did the trick:
Before:
After:
Problem solved! Thank you all
One scenario in which that might happen is this:
Have you checked the constraints? any of them are overlapped/ clipped or not defined any constraints at all? (In case of new Views and not the BG color)