I create launchScreen for pause view like this.
func applicationWillResignActive(_ application: UIApplication) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let launchScreen = storyboard.instantiateViewController(withIdentifier: "launchScreen")
launchScreen.restorationIdentifier = "launchScreen"
var rootViewController = UIApplication.shared.keyWindow?.rootViewController
while let presentController = rootViewController?.presentedViewController {
rootViewController = presentController
}
rootViewController?.present(launchScreen, animated: false, completion: nil)
}
func applicationDidEnterBackground(_ application: UIApplication) {
guard let passcodeManageView = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "passcodeManageView") as? PasscodeManageViewController else { return }
passcodeManageView.state = State.loginMode
passcodeManageView.modalPresentationStyle = .overFullScreen
var rootViewController = UIApplication.shared.keyWindow?.rootViewController
while let presentController = rootViewController?.presentedViewController {
rootViewController = presentController
}
rootViewController?.present(passcodeManageView, animated: false, completion: nil)
}
But, How to dismiss launchScreen in applicationDidEnterBackground(:_)??
How can I find specific view controller and that dismiss??