2016-09-16 36 views
0

我已經從collectionView didselect方法這樣傳遞數據通過在swift 3中不工作的任何解決方案?

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?) 

不調用快捷3傳遞的數據...任何解決方案?

回答

3

prepareForSegue在SWIFT 3.0改變,所以你需要寫這樣

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

} 
+0

@ Nirav D great right anser –

2

除了上面的回答,你應該期望很像方法名的變化:prepareForSegueprepareString.substringFromIndexString.substring。明顯的方法名稱結尾被忽略/移動到第1個參數的標籤。

相關問題