스토리보드에서 우클릭 드래그로 화면전환하는 것이 아닌 코드로 전환하는 방법을 알아보겠다.
@objc func didClick(sender: UITapGestureRecognizer) {
let VC = ChangeViewController()
VC.modalPresentationStyle = .fullScreen
present(VC, animated: true)
}
간단한게 VC로 띄울 ViewController를 선언 해준다.
이 후 present(VC, animated: true) 로 present 해주면 된다.
이 때 modalPresentationStyle은 fullscreen으로 화면에 꽉 채우는 방법이다. 만약 지정을 안해주면 위쪽에 공간이 남는 형식으로 된다.