1
如何從下面的cole中獲取項目值?集合視圖indexpathforitematpoint項目
let pointInTable: CGPoint = sender.convertPoint(sender.bounds.origin, toView: self.collectionView)
let cellIndexPath = self.collectionView?.indexPathForItemAtPoint(pointInTable)
println(cellIndexPath)
我目前顯示這個,但需要整數值。
Optional(<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 1})
什麼「整數值」?你不明白日誌消息的哪一部分?你不知道NSIndexPath是什麼?你不知道什麼是可選的?這裏有什麼問題? – matt 2014-10-29 15:15:47