How to change the value of a label in ViewController using tableview by selecting a cell
Here is the class
import UIKit class CreateNoteViewController : UIViewController, UITextFieldDelegate, UITextViewDelegate { var tableData = ["One","Two","Three"] let labelSpecieText = "Specie" @IBOutlet weak var nameField: UITextField! @IBOutlet weak var labelSpecie: UILabel! required init (coder aDecoder:(NSCoder!)){ super.init(coder:aDecoder)! } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) labelSpecie.text = labelSpecieText } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return tableData.count } func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!{ let cell:UITableViewCell = UITableViewCell(style:UITableViewCellStyle.Default, reuseIdentifier:"CellSpecie") cell.textLabel?.text = tableData[indexPath.row] return cell } func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let path = tableView.indexPathForSelectedRow let cell = tableView.cellForRowAtIndexPath(path!) labelSpecie.text = cell!.textLabel?.text } } 

labelSpecie.text = tableData[indexPath.row]? - Max Mikheyenko