点击tableviewcell跳转
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
//定义 storyboard
let suggestVC = storyboard?.instantiateViewController(withIdentifier: "suggestVCID") as! suggestVC
//通过row进行判断,点击不同的row跳转到不同的页面
if indexPath.row == 0{
navigationController?.pushViewController(suggestVC, animated: true)
}else if indexPath.row == 1{
}
else if indexPath.row == 2{
}
}
点击返回按钮返回上一页
@IBAction func backBtn(_ sender: UIButton) {
navigationController?.popViewController(animated: true)
}