У меня есть UITableView
с прототипом ячеек, который по существу занимает всю страницу. У меня есть UIButton
на самом дне, который должен отображать всплывающее статическое UITableView
при нажатии. Я изо всех сил пытаюсь объяснить всплывающее представление таблицы в cellForRowAtIndexPath
.Два вида на столе в поле зрения: Swift
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let result: UITableViewCell
if tableView == self.tableView {
var cell = self.tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
cell.textLabel!.text = array[indexPath.row]
result = cell
} else if tableView == self.popUpTableView {
var popUpCell = self.popUpTableView.dequeueReusableCellWithIdentifier("popUpCell", forIndexPath: indexPath) as! UITableViewCell
popUpCell.textLabel!.text = popUpArray[indexPath.row]
result = popUpCell
}
return result
}
Я получаю сообщение об ошибке в return result
, где Variable 'result' used before being initialized
, но я объявляю его на самом верху. Где я ошибаюсь?