我有一個自定義的UICollection View Cell。其中一個單元的財產是cellImageView
。當用戶選擇一個單元格時,我想將該圖像從該視圖(cellImageView.image
)傳遞到下一個單元格。以下是我試過的:Custom CollectionView Cell PrepareForSegue
if let indexPath = self.collectionView?.indexPathForCell(sender as! UICollectionViewCell)
{
if segue.identifier == "show"
{
var segue = segue.destinationViewController as! ViewPhoto
segue.imageURL = URLToPass
}
}
但很快意識到這是錯誤的路線。要做到這一點,最好的方法是什麼?提前致謝。
看起來對我來說很好,你認爲這是錯誤的嗎? – Icaro
看起來也在我身上發現,除了變量名稱segue,這是不明確的。 –
走這條路之後,有沒有辦法讓cellImageView.image –