我有一個UITableView完整的UICollectionView的。 UICollectionViews需要知道它們包含在哪個UITableViewCell中。我無法弄清楚如何找到這個值。我如何找到父UITableViewCell的索引值?
我做這個標籤分配給每個的UITableViewCell:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: TableViewCell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as! TableViewCell
cell.tag = indexPath.row
return cell
}
我需要檢索標籤在這裏再次:
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
let tableIndex = //WHAT DO I PUT HERE?
return masterArray[tableIndex].count
}
是的,我想這也行得通!你能幫我嗎? – bkwebhero
你知道哪個'UITableView'是一個'UICollectionView'屬於你的數據模型。 – zaph
我不太清楚你的意思是...我在學習。你介意闡述嗎? – bkwebhero