title: Swift making labels disappear when button is clicked
body: <p>I would like to make a label disappear and reappear with a click of a button and then reappear with the click of the button again, to reduce clutter on screen.</p>
  
  <p>The following code when it was first run made the button disappear. Which I wanted it to do, but when I closed it off and then ran it again and hit the button the code all of a sudden didn't work meaning that my label didn't disappear. I have not changed any of the code; all I did was run it again.</p>
  
  <p>I am doing this as part of a group project at school. If anyone can help me with my problem that would be great. Thanks. </p>
  
  <p>P.S. <code>PrepInfo</code> is the button I'm trying to hide and <code>PrepButtton</code> is the button that when pressed, I want to make the <code>PrepInfo</code> label disappear.</p>
  
  <pre><code>import UIKit
  
  class BackgroundViewController: UIViewController {
      @IBAction func PrepButton(sender: AnyObject) {
          func hide() {
              PrepInfo.hidden = false
          }
  
          hide()
      }
  
      @IBOutlet weak var PrepInfo: UILabel!
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
  
      }
  
  
      /*
      // MARK: - Navigation
  
      // In a storyboard-based application, you will often want to do a little preparation before navigation
      override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
          // Get the new view controller using segue.destinationViewController.
          // Pass the selected object to the new view controller.
      }
      */
  }
  </code></pre>