首先,我不想使用storyboard。我能够“present”目标视图控制器,但我无法让其显示标准iOS顶部的返回按钮。我的理解是,如果通过推送控制器,就可以让它正常工作。我没有收到任何错误提示,但什么也没有发生。
当点击一个按钮时,会运行以下代码。注释掉的代码成功呈现了ForgotPasswordPage:
// 切换到忘记密码页面
func forgotPasswordSwitch(sender: UIButton!) {
//let ForgotPassword:ForgotPasswordPage = ForgotPasswordPage()
//self.presentViewController(ForgotPassword, animated: true, completion: nil)
let ForgotPassword = ForgotPasswordPage()
self.navigationController?.pushViewController(ForgotPassword, animated: true)
}