Swift 界面跳转的几种方式

用带navigationController方式跳转

let storyboard = UIStoryboard(name: "AccountInfo", bundle: nil)
let optVerifVC = storyboard.instantiateViewController(withIdentifier: "accountOTPVC") as! AccoutInfoVerifyCodeViewController
optVerifVC.Modeltype = "cominfo"  //传值

PUSH方式跳转

self.navigationController?.pushViewController(optVerifVC, animated: true)

PRESENT方式跳转

self.navigationController?.present(optVerifVC, animated: true, completion: nil)

转场动画方式

optVerifVC.modalPresentationStyle = UIModalPresentationStyle.automatic

UIStoryboard方式跳转

以button为例 按住control拖到想要跳转到界面即可


storyboard跳转方式.png

你可能感兴趣的:(Swift 界面跳转的几种方式)