I have put an image
in imageView
in LaunchStoreyboard
. How can I delay the time of image programmatically?
Here is the Launch Screen Guideline from Apple.
Here is code for Launch Screen View controller:
import UIKit class LaunshViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.delay(0.4) } func delay(_ delay:Double, closure:@escaping ()->()) { let when = DispatchTime.now() + delay DispatchQueue.main.asyncAfter(deadline: when, execute: closure) } }
There are a number of options for you to choose from. To configure the background color, set the key to Background color and value to LaunchScreenBackground , which is the color set created in the previous section. To include an image in the launch screen, click the + button to add another key. Set it to Image Name .
Put one line of code in AppDelegate class -
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { Thread.sleep(forTimeInterval: 3.0) // Override point for customization after application launch. return true }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With