title: Swift display core-data on a label
body: <p>I wanted to know how I would get my app that uses core data to save user data to print the stored data (preferable in a string) when I press "display" on a label. </p>
  
  <p>Thanks.</p>
  
  <p>Here's my code for my insert function; what would it look like to put it on a label named 'display'?</p>
  
  <pre><code>    @IBAction func insertStudent(_ sender: AnyObject) {
      let context = getContext()
      let entityDescription = NSEntityDescription.entity(forEntityName: "Contacts", in: context)
  
      let contact = NSManagedObject(entity: entityDescription!, insertInto: context) as! Contacts
  
      contact.name = name.text
      contact.address1 = address1.text
      contact.address2 = address2.text
      contact.city = city.text
      contact.grade = grade.text
      contact.state = state.text
      contact.zip = zip.text
  
      var error: NSError?
  
      //save the object
      do {
          try context.save()
          status.text = ("saved!")
      } catch let error as NSError  {
          status.text = ("Could not save \(error), \(error.userInfo)")
      } catch {
  
      }
  
    }
  
    override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
    }
  }
  </code></pre>