我需要翻譯成雨燕3.0爲我的當前項目。這裏有一個辦法做到這一點:
//Get the storyboard that contains the VC you want
let storyboard = UIStoryboard(name: "Main", bundle: nil)
//Get the VC you want to push onto the stack
//You can use storyboard.instantiateViewController(withIdentifier: "yourStoryboardId")
guard let vc = storyboard.instantiateInitialViewController() else { return }
//Get the current app delegate
guard let appDel = UIApplication.shared.delegate as? AppDelegate else { return }
//Set the current root controller and add the animation with a
//UIView transition
appDel.window?.rootViewController = vc
UIView.transition(with: appDel.window!,
duration: 0.25,
options: .transitionCrossDissolve,
animations: { appDel.window?.rootViewController = vc } ,
completion: nil)
[我如何做一個淡入/否視圖控制器之間的轉換(的
可能重複http://stackoverflow.com/questions/10961926/how-do-i-do -a-fade-no-transition-between-view-controllers) – BangOperator
你的代碼隱藏了導航條 – user2070775