首页 > 解决方案 > 我应该如何编码导致相同 segue 模板的多个集合?

问题描述

![截图] https://imgur.com/a/D4hBy37

从屏幕截图中可以看出,我在右侧有多个集合视图。所有这些都导致相同的segue模板,我需要区分数据但我无法弄清楚

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

    if(segue.identifier=="cardToDiscover" && sender is BaroqueData){

        let toViewController = segue.destination as! PlacesInDepthViewController
        let indexPath = sender as! IndexPath
        toViewController.section = baroqueData.sections[indexPath.row]


    }

}

baroqueData 是一个包含数据的模型,但对于屏幕截图上显示的每个集合视图应该是不同的。

标签: iosswiftxcode

解决方案


推荐阅读