Commit 5670a7b9 authored by Alex朱枝文's avatar Alex朱枝文

优化跳转到方案页的逻辑,避免循环嵌套

parent bae10749
...@@ -164,8 +164,14 @@ class YHSurveyMatchResultViewController: YHBaseViewController { ...@@ -164,8 +164,14 @@ class YHSurveyMatchResultViewController: YHBaseViewController {
@objc private func matchButtonClicked() { @objc private func matchButtonClicked() {
if pageType == .success { if pageType == .success {
let vc = YHPlanViewController() guard let navigationController = self.navigationController else {
navigationController?.pushViewController(vc) return
}
let ctl = YHPlanViewController()
ctl.hidesBottomBarWhenPushed = true
var viewControllers = Array(navigationController.viewControllers.prefix(1))
viewControllers.append(ctl)
navigationController.setViewControllers(viewControllers, animated: true)
} else { } else {
matchAgainEvent?() matchAgainEvent?()
navigationController?.popViewController() navigationController?.popViewController()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment