異なる色のセルを使って異なるカテゴリにセルを分割するアプリを作っていますが、ユーザーがセルをタップしてチェックマークを付けて選択する機能もあります。色付きのセルを無効にして、ユーザーがそれらをタップするとセルにチェックマークを付けずに選択するようにしたいと思います。は、背景色に基づいてセルを無効にすることはできません
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cellIdentifier = "instrumentTableCell"
let cell: InstrumentTableCell! = tableView.dequeueReusableCellWithIdentifier(identifier) as? InstrumentTableCell
checked = Array(count:recipies.count, repeatedValue:false)
cell.configurateTheCell(recipies[indexPath.row])
if !checked[indexPath.row] {
cell.accessoryType = .None
} else if checked[indexPath.row] {
cell.accessoryType = .Checkmark
}
return cell
}
'cell.userInteractionEnabled'は役に立ちますか? – paulvs
@paulvsうまく働いた! – zach2161
答えとして追加しました。 – paulvs