我有4个单元格,每个单元格中都有一个标签。使用条件执行segue并发送数据如果条件
每当用户点击一个单元格,将带他们到一个不同的看法,并在该视图我有一个顶部标签应命名为喜欢的单元格标签。所以,如果我点击细胞001那么接下来的页面标题标签应该低于001图片显示标题标签:但是
我用SEGUE准备通过标题标签的价值,我怎么能写代码,说:
if cell label = 001 {
newViewTitle.text = cell label
}
这是我目前的代码赛格瑞准备:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let destination = segue.destination as? VolumeImgVC {
if let VolumeNumLbl = volumEDnum as? String! {
destination.Vtitle = VolumeNumLbl
}
if let VolumeNumLbl = volumEDnum1 as? String! {
destination.Vtitle = VolumeNumLbl
}
if let VolumeNumLbl = volumEDnum2 as? String! {
destination.Vtitle = VolumeNumLbl
}
}
}
上面的代码不工作,ONL y执行最后一个let语句。
有什么建议吗?谢谢
你想当前单元格的数据传递到一个视图控制器? –