传递数据通过segue无法在swift 3中工作任何解决方案? [英] Pass data Through segue not working in swift 3 any solution?

查看:130
本文介绍了传递数据通过segue无法在swift 3中工作任何解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从 collectionView 的didselect方法传递了数据

i have passed data from didselect method of collectionView like this

 func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

        let dicttemp = (arrRespProduct?.object(at: indexPath.row))! as! NSDictionary
        dicData = NSMutableDictionary(dictionary: dicttemp)

         performSegue(withIdentifier: GlobalConstant.segueIdentofier.productDetail, sender: self)
    }

但方法

func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) 

没有在swift 3中调用...任何解决方案?

is not calling in swift 3... Any solution?

推荐答案

prepareForSegue 在swift 3.0中已更改,因此您需要像这样写

prepareForSegue is changed in swift 3.0 so you need to write like this

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

}

这篇关于传递数据通过segue无法在swift 3中工作任何解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆