セルをいくつかのデータで塗りつぶすテーブルビューを作成しました。これは正常に動作します。スクロール後にテーブルビューのセルが混在する(スウィフト)
問題は、私がテーブルをスクロールすると、すべてのセルが混ざり合ってしまいます。これをやめる方法は分かりますか?
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let celda = tabla_reportes.dequeueReusableCellWithIdentifier("celda", forIndexPath: indexPath) as! celdaReportes
switch indexPath.section {
case 0:
celda.datos = tipos
celda.back = UIColor.lightGrayColor()
case 1:
celda.index = indexPath.row
celda.datos = fillArrayWithData(datos[indexPath.row] as! NSDictionary)
celda.back = UIColor.clearColor()
default:
break
}
celda.delegate = self
return celda
}
チップのおかげで、固定! –