// // NewPlayerViewController.swift // GestureDemo // // Created by Sally McNichols on 2/16/15. // Copyright (c) 2015 Sally McNichols. All rights reserved. // import UIKit protocol NewPlayerDelegate { func receivedNewPlayer(name: String) } class NewPlayerViewController: UIViewController { @IBOutlet var nameTextField: UITextField! var delegate: NewPlayerDelegate! @IBAction func submit(sender: AnyObject) { self.view.endEditing(true) self.delegate.receivedNewPlayer(self.nameTextField.text!) self.dismissViewControllerAnimated(true, completion: nil) } }