Search code examples
swiftxcodelaunch

Delaying the launch screen on Xcode


I'm working on Xcode to develop an iOS App.

I would like to delay the launch screen for at least 5 seconds or more in order to analyze the graphic rendering on different devices.

I've added this line to my AppDelegate file but it seems it's not working RunLoop.currentRunLoop.runUntilDate(NSDate(timeIntervalSinceNow: 5))

Is this the correct method ? Could you suggest another way to do it please ? Thank you


Solution

  • I found this solution so I can delay/freeze my launchscreen for some seconds, if anyone is interested or was looking for a way to do it.

    Thread.sleep(forTimeInterval: 5.0)

    DISCLAIMER : This is not a recommanded way. I'm using this method only for one purpose, delaying the launch screen for some seconds and I'll be commenting the code after that. Would not recommending setting the entire application in a waiting state. If the application needs to do more work before finishing, the watchdog could kill the application for taking too long time to start up.