不同界面纯代码跳转
@objc func goNextPage(_ sender:Any) {
//拿到ViewController
let nextPage = self.storyboard!.instantiateViewController(withIdentifier: "NextViewController") as! TestViewController
//跳转
self.navigationController?.pushViewController(nextPage, animated: true)
}
屏幕快照 2020-06-15 下午9.28.47.png
storyboard跳转的页面要设置identity里的storyboard ID与之一样:NextViewController
网友评论