在主要的 ViewController 中:
let secondPage = SecondViewController() self.present(secondPage, animated: true, completion: nil)
在開啟的頁面中離開的方法:
self.dismiss(animated: true, completion: nil)