Create a new Swift File: In your Xcode project, right-click on the project's folder in the Project Navigator and select "New File from Template" -> "Cocoa Touch Class". Name it "SplashVC.swift".
Update your AppDelegate.swift like
@main class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
private let navigationController = UINavigationController()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = navigationController
window?.makeKeyAndVisible()
goToSplashScreen()
return true
}
private func goToSplashScreen() {
let splashViewController = SplashVC(nibName: "SplashVC", bundle: nil)
navigationController.setViewControllers([splashViewController], animated: false)
}
}