I'm having trouble passing data after selecting a table view cell to the previous view controller. I'm pretty much trying to change a label from the previous view controller after selecting a table view cell. Could anyone help me go about this? I'm trying to change the UITextField after selecting a cell.

UIViewController:

```
class WhoToOdds: UIViewController, sendBack,UITextFieldDelegate{

    @IBOutlet var chosenContact: UITextField!

    @IBOutlet var oddsTextBox: UITextView!

    var friend: String?

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)

        navigationController?.setNavigationBarHidden(false, animated: true)
    }

    func sendNameToPreviousVC(selectedfriendName: String) {
        friend = selectedfriendName
        chosenContact.text = friend

    }

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view, typically from a nib.

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if segue.identifier == "friendList"{
            let friendViewController = (segue.destinationViewController as! friendListController)

        var fbRequest = FBSDKGraphRequest(graphPath:"/me/friends", parameters: nil);
        fbRequest.startWithCompletionHandler { (connection : FBSDKGraphRequestConnection!, result : AnyObject!, error : NSError!) -> Void in

        if error == nil {

            println("Friends are : \(result)")
            PFUser.currentUser()?["friend_list"] = result

            PFUser.currentUser()?.save()
            print(result)

            var resultdict = result as! NSDictionary
            println("Result Dict: \(resultdict)")
            friendViewController.friendArray = resultdict.objectForKey("data") as! NSArray

            } }
        }
    }

    @IBAction private func submitChallenge(sender: AnyObject) {
        navigationController?.popViewControllerAnimated(true)
    }
}

```

TableViewController:

```
protocol sendBack
{
    func sendNameToPreviousVC(contact: String)
    }

    class friendListController: UITableViewController, UITableViewDataSource, UITableViewDelegate{

    var friendArray:NSArray = ["a","b","c"]
    var valueDict:NSDictionary = [:]
    var mDelegate:sendBack?

    var selectedFriend :String?

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)

        navigationController?.setNavigationBarHidden(false, animated: true)
    }

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return friendArray.count
    }

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier("friend", forIndexPath: indexPath) as! UITableViewCell

        cell.textLabel!.text = (friendArray[indexPath.row] as! String)

        return cell
    }

    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath){

        let indexPath = tableView.indexPathForSelectedRow();
        let currentCell = tableView.cellForRowAtIndexPath(indexPath!) as UITableViewCell!

        selectedFriend = currentCell.textLabel!.text as String!

        sendBackFriendList(selectedFriend!)
        navigationController?.popViewControllerAnimated(true)
    }

    func sendBackFriendList(name: String){
       self.mDelegate?.sendNameToPreviousVC(name)
    }
}

```