title: Change the text of a label with a button in iOS
body: <p>Firstly, let me say I'm new to Swift and Xcode. I have a label that displays some text and I want that text to change when a button is pressed.</p>
  
  <p>Here is the code in the UIViewController:</p>
  
  <pre><code>var txt = "Hey"
  
  @IBOutlet weak var Text: UILabel!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view, typically from a nib.
      showText()
  }
  
  func showText(){
      Text.text = txt
  }
  
  @IBAction func Button(_ sender: Any) {
      txt = "Hello"
  }
  </code></pre>
  
  <p>The buttons and labels are correctly linked to their main.storyboard counterparts. When I run this and press the button the text doesn't change.</p>