Rushi Rushi - 1 year ago 214
iOS Question

Pass data Through segue not working in swift 3 any solution?

i have passed data from didselect method of

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)

But method

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

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

Answer Source

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download