Skip to content

Instantly share code, notes, and snippets.

@marianomike
Created January 28, 2017 01:00
Show Gist options
  • Save marianomike/efc8767abe0fb91cbbc3ebd3c94e3d86 to your computer and use it in GitHub Desktop.
Save marianomike/efc8767abe0fb91cbbc3ebd3c94e3d86 to your computer and use it in GitHub Desktop.
import UIKit
class SecondViewController: UIViewController {
// reference the new text field
@IBOutlet weak var DisplayField: UITextField!
// create variable for new text field to display
var userText:String! = ""
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
//display the string passed from the first view controller
DisplayField.text = userText
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func GoBack(_ sender: UIButton) {
self.performSegue(withIdentifier: "unwindToMenu", sender: self)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment