Hi everyone,
I'm building a Swift app using Storyboards. I've been working fine for a few months now, but all of a sudden my app won't load properly. Whenever I open it on a Simulator or my physical iPhone, the launch screen is displayed before a black screen appears.
My Mac is on macOS Big Sur Developer Beta 5 with Xcode 12 Beta 6, and my iPhone is on iOS 14 Developer Beta 5.
This happened all of a sudden and I don't recall doing anything to cause it.
Here's what I've tried so far...
Renaming the storyboard and updating the target's General tab to the new name, as well as doing the same but manually editing Info.plist
Moving the storyboard in and out of "Copy Bundle Resources"
Updating to the latest Xcode 12 beta (I'm on macOS Big Sur)
Clearing Derived Data with DevCleaner
Starting a whole new project and moving all of my code and resources over via drag-and-drop (Interesting observation: when I started a new project, I added a simple label to the default Main.storyboard and ran it on my iPhone. The label wasn't displayed.
Adding a function to my AppDelegate to load the storyboard manually on launch
Adding various print statements in AppDelegate and my Home View Controller
AppDelegate
I've addedCode Block swift let storyboard = UIStoryboard(name: "Main", bundle: nil) let initialViewController = storyboard.instantiateViewController(withIdentifier: "Home") self.window.rootViewController = initialViewController self.window.makeKeyAndVisible() print("App launched")
to my AppDelegate. Now, when I run my app, I get
printed. I also added
Code Block swift override func viewDidLoad() { super.viewDidLoad() print("Home view loaded")
to my Home View Controller.
Now, when I run my app, I get this printed in Xcode:
Code Block text 2020-08-28 13:11:20.140963+0100 MY-APP[11077:1951343] libMobileGestalt MobileGestaltCache.c:166: Cache loaded with 4536 pre-cached in CacheData and 53 items in CacheExtra. 2020-08-28 13:11:20.759943+0100 MY-APP[11077:1951162] Metal API Validation Enabled Home view loaded App launched
Still, nothing on my iPhone. The launch screen appears, fades to black, and that's it. I'm so confused.
If anyone knows how to fix this, or something I can try, please let me know. Thank you in advance!