Falta el retorno UITableViewCell
Estoy seguro de que esta pregunta se ha hecho antes, pero no puedo encontrar una respuesta que resuelva mi problema con la lógica anidada if-else y switch-case.
tengo unUITableView
con dos secciones, cada sección tiene dos celdas personalizadas. Eso es todo. 4 celdas. Pero no importa lo que haga, obtengo "Falta el retorno en una función que se espera que regreseUITableViewCell
"
Pregunta ¿Cómo puedo cambiar esta configuración para obtener una instrucción else en la parte inferior que satisfaga la lógica rápida?
Cualquier ayuda sería muy apreciada
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
if indexPath.section == 0{
switch (indexPath.row) {
case 0:
let cell0: SettingsCell! = tableView.dequeueReusableCellWithIdentifier("cell0", forIndexPath: indexPath) as! SettingsCell
cell0.backgroundColor = UIColor.redColor()
break
case 1:
let cell1: SettingsCell! = tableView.dequeueReusableCellWithIdentifier("cell1", forIndexPath: indexPath) as! SettingsCell
cell1.backgroundColor = UIColor.whiteColor()
break
default:
break
}
}
if indexPath.section == 1{
switch (indexPath.row) {
case 0:
let cell10: SettingsCell! = tableView.dequeueReusableCellWithIdentifier("cell10", forIndexPath: indexPath) as! SettingsCell
cell10.backgroundColor = UIColor.redColor()
break
case 1:
let cell11: SettingsCell! = tableView.dequeueReusableCellWithIdentifier("cell11", forIndexPath: indexPath) as! SettingsCell
cell11.backgroundColor = UIColor.whiteColor()
break
default:
break
}
}
}