title: Delete class instances in Swift
body: <p>I'm trying to fully understand the process of creating class objects in Swift.  Adhering to the idea of MVC, I have the following simple class to represent my data model:</p>
  
  <pre><code>// Person.swift
  
  import Foundation
  
  class Person {
  
      var first: String = "first"
      var last: String = "last"
  }
  </code></pre>
  
  <p>In my view controller I have two <code>IBOutlets</code> connected to <code>UITextFields</code>.  Using the <code>IBAction</code> method, I set the <code>first</code> and <code>last</code> variables with the text from the text fields.</p>
  
  <pre><code>//  ViewController.swift
  
  import UIKit
  
  class ViewController: UIViewController {
  
      @IBOutlet weak var firstName: UITextField!
      @IBOutlet weak var lastName: UITextField!
  
      // MARK: - Lifecycle
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
      }
  
      // MARK: - IBAction
      @IBAction func addPerson(sender: AnyObject) {
  
          let peep = Person()
          peep.first = firstName.text
          peep.last = lastName.text
          println("\(peep.first) \(peep.last)")
      }
  }
  </code></pre>
  
  <p>Each time the <code>IBAction</code> method is called, a new instance of the <code>Person</code> class is created.  For my example, I am only interested in the latest <code>Person</code> instance.  How do I delete the pervious instance variables?</p>