@IBAction func 함수명(_ sender: Any) {
guard let 이동할뷰컨 = self.storyboard?.instantiateViewController(withIdentifier: "뷰컨아이디") else {return}
self.present(이동할뷰컨, animated: true, completion: nil)
}
다음VC와 이전VC가 같은 스토리보드 파일에 있는 경우
let nextScene = self.storyboard!.instantiateviewController(Identifier: "AfterViewController"
다음VC와 이전VC가 다른 스토리보드 파일에 있는 경우
let storyboard = UIStoryboard(name : "<스토리보드 파일명>", bundle: Bundle.main)
let afterVC = storyboard.instantiateViewController(identifier: "AfterViewController")
화면전환코드
let vcName = self.storyboard?.instantiateViewController(withIdentifier: "PhoneCheckViewController")
vcName?.modalPresentationStyle = .fullScreen //전체화면으로 보이게 설정
vcName?.modalTransitionStyle = .crossDissolve //전환 애니메이션 설정
self.present(vcName!, animated: true, completion: nil