5
UICollectionView
sayfamın bir hücresine ihtiyacım var. Bunu nasıl yapacağımı biliyorum, ancak bu NSIndexpath
'u Int
'a dönüştürdüğüm sorun. Bu benim kodum. sınıfta NSIndexPath
yılındaNasıl Convert NSIndexPath Int Int?
var row: Int { get }
: Sen index.row
Int
dönüştürmek gerekmez
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let cell = sender as! UICollectionViewCell
let index = self.collectionView!.indexPathForCell(cell)!
let vc : VideosViewController = segue.destinationViewController as! VideosViewController
vc.id_category = self.result_category[index.row as Int]["id"].intvalue
}
Bir kullanıcı bir hücre seçtiğinde segue ateş ediyor musunuz? –