Retorno ausente UITableViewCell
Tenho certeza de que essa pergunta já foi feita antes, mas não consigo encontrar uma resposta que resolva meu problema com a lógica aninhada if-else e switch-case.
eu tenho umUITableView
com duas seções, cada seção possui duas células personalizadas. É isso aí. 4 células. Mas não importa o que eu recebo "Retorno ausente em uma função que deve retornarUITableViewCell
"
Pergunta, questão Como posso alterar essa configuração para obter uma instrução else na parte inferior que satisfaça a lógica rápida?
Qualquer ajuda seria muito bem vinda
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
}
}
}