set root view controller ios 13
static func redirectToMainNavRVC(currentVC: UIViewController){
let appDelegate = UIApplication.shared.delegate as! AppDelegate
let vc = UIStoryboard(name: appDelegate.storyBoardName, bundle: nil).instantiateViewController(withIdentifier: "MainNavigationViewController") as! MainNavigationViewController
if #available(iOS 13.0, *){
if let scene = UIApplication.shared.connectedScenes.first{
guard let windowScene = (scene as? UIWindowScene) else { return }
print(">>> windowScene: \(windowScene)")
let window: UIWindow = UIWindow(frame: windowScene.coordinateSpace.bounds)
window.windowScene = windowScene //Make sure to do this
window.rootViewController = vc
window.makeKeyAndVisible()
appDelegate.window = window
}
} else {
appDelegate.window?.rootViewController = vc
appDelegate.window?.makeKeyAndVisible()
}
}
Also in Swift:
- how to replace certain characters in string swift
- how to add two right bar button item xcode
- get index filter swift
- core data save
- swift check if regex is in string
- swift retrieve value from dictionary
- swift get current hour
- swift navigation bar title font
- swift uiview gradient
- swift thread.sleep
- swift initialize a view
- how to dismiss a view when touch up inside swift
- uitextfield numbers only
- conert data to string swift
- swift get day from available string
- how to change background color swift
- swift zstack
- string to double swift
- how to dismiss keyboard swiftui
- activity indicator swiftui
- swift add navigation bar
- swift move textfield when keyboard appears
- check google ads sdk version swift
- how to darken view swiftui