我的 didSelectRowAt 部分代码出现问题。
我的菜单(目前为止)有:锻炼,提示,联系我们。他们都有一个专门用于他们视图的特殊UIViewController。在我的didSelectRowAt函数中,我有一个开关案例:
UIViewController.swift
switch indexPath.row {
case 0:
// Call Workout View
self.performSegue(withIdentifier: "wrkOut", sender: self)
case 1:
self.performSegue(withIdentifier: "tipsN", sender: self)
workoutView.swift
class workoutview: UIViewController {
override func viewDidLoad() { super.viewDidLoad() }
记住“wrkOut”是Workout视图的标题,而不是push segue。当我尝试代码时,它只是在点击时显示黑屏。我尝试用ctrl拖动推送segue到每个视图,但它只能指向其中一个。
如何在单击行时对此进行编码以转到特定的UIViewController?我们不得不出于任何原因使用push segues。