---------------------------------------------------------------------------------------
self.dismiss(animated: true, completion: {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "secondViewController")
self.present(vc!, animated: true, completion: nil)
})
=========================================================================
아래 오류가 뜬다.
whose view is not in the window hierarchy!
이때는 뷰계층구조상 rootViewController를 사용해야한다.
---------------------------------------------------------------------------------------
self.dismiss(animated: true, completion: {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "secondViewController")
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController!.present(vc, animated: true, completion: nil)
self.dismiss(animated: true, completion: {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "secondViewController")
self.present(vc!, animated: true, completion: nil)
})
=========================================================================
아래 오류가 뜬다.
whose view is not in the window hierarchy!
이때는 뷰계층구조상 rootViewController를 사용해야한다.
---------------------------------------------------------------------------------------
self.dismiss(animated: true, completion: {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "secondViewController")
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController!.present(vc, animated: true, completion: nil)
})
=========================================================================
이렇게 하면 기존의 firstViewController는 닫히고 secondViewController 가 열린다
블로그 관리자가 댓글을 삭제했습니다.
답글삭제