I am using a Launch Screen storyboard as well as a Main storyboard in my Swift app. Sometimes the app will show the launch storyboard and then go to a black screen. Other times it correctly goes to the Main storyboard entry point. It almost seems like it is build-dependent in that if I clean and rebuild a few times, a build pop out that behaves properly. Any ideas what may be causing this?
To add some clarification:
This might help: I put in the following code in the offending view:
override func viewDidAppear(animated: Bool) {
print(self.view.layer.bounds.width);
print(self.view.layer.bounds.height);
}
When the black screen issue occurs, I get 260 and 17. When the view presents correctly, I get the 5s (simulator) dimensions of 320 and 568. Does that help anyone help me?
I finally solved this. After weeks of battling it and trying everything from ripping ALL of my code out, it turns out that the view outlet for my view in the storyboard had become double-linked to both "View" and one of my text fields in that view. Like this:
I have since deleted the linkage to the text field, but show the correct linkage here:
Interestingly, I am unable to reproduce this accidental connection in the UI, so I am not sure how that even happened. Anyway, I hope this helps others that might come across this.