Сначала вы должны объявить подкласс UITableViewCell с точек и соединить их с прототипом
class MyCustomCell: UITableViewCell {
@IBOutlet weak var label1: UILabel!
@IBOutlet weak var label2: UILabel!
@IBOutlet weak var label3: UILabel!
}
Тогда ваш Tableview (Tableview: cellForRowAtIndexPath indexPath :) метод будет выглядеть следующим образом:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell: UITableViewCell? = tableView.dequeueReusableCellWithIdentifier("cell id")
if (cell == nil) {
cell = MyCustomCell()
}
(cell as MyCustomCell).label1.text = "Some text"
(cell as MyCustomCell).label2.text = "Some text"
(cell as MyCustomCell).label3.text = "Some text"
return cell;
}
Добавить настраиваемое действие для каждой ячейки, которое вы можете, переопределив метод tableView (tableView :, didSelectRowAtIndexPath indexPath :) UITableViewDelegate:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
switch(indexPath.row) {
case 1:
action1()
case 2:
action2()
//and so on
}
}