title: How can I make a cell in tableview that has multiple fields?
body: <p>I want to make a tableview with different people. You can add a person by clicking the add button. When you click the add button, you fill out the information 'first name','last name',and 'date'. When you click the done button, it goes back to the tableview and the cell shows the persons first name.</p>
  
  <p>I created a new swift file that has a struct:</p>
  
  <pre><code>struct person {
     var firstName : String
     var lastName : String
     var date : String
  }
  </code></pre>
  
  <p>In the tabledetailviewcontroller.swift (controller where you add a person) I declare IBOutlets for each field and set each value:</p>
  
  <pre><code>@IBOutlet weak var firstName: UITextField!
  @IBOutlet weak var lastName: UITextField!
  @IBOutlet weak var dateText: UITextField!
  
  let first:String = ""
  let last:String = ""
  let date = NSDateFormatter.localizedStringFromDate(NSDate(), dateStyle: .MediumStyle, timeStyle: .ShortStyle)
  
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
      if segue.identifier == "doneSegue" {
          first = firstName.text
          last = lastName.text
          date = dateText.text
      }
  }
  </code></pre>
  
  <p>In the tableviewcontroller.swift I have declared an array of people with type 'person':</p>
  
  <pre><code>var people = [person]()
  </code></pre>
  
  <p>and a function that returns the number of people in the array.</p>
  
  <pre><code>override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
     return people.count
  }
  </code></pre>
  
  <p>then I have a function that sets the text value of the cell
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> </p>
  
  <pre><code>UITableViewCell {
     let cell = tableView.dequeueReusableCellWithIdentifier("issueCell", forIndexPath: indexPath) as UITableViewCell
  
     //cell.textLabel.text = issues.dateTime[indexPath.row] //Fixed this to this =&gt;
     cell.textLabel.text = (issues[indexPath.row]).dateTime
  
     return cell
  }
  </code></pre>
  
  <p>finally I have a done button that appends the new person to the array (this part keeps giving me errors...)</p>
  
  <pre><code>@IBAction func done(segue:UIStoryboardSegue){
          var addPersonVC = segue.sourceViewController as AddPersonViewController
          let newPerson = person(date: (addPersonVC.date)) //Breaks here for no reason!
  
          people.append(newPerson)
      }
  </code></pre>
  
  <p>My question is, how can I make each cell store multiple fields (first, last, date), save it in under each person and have the person's name show up in the cell in the tableview? I want to be able to edit a cell and change information about that person.</p>
  
  <p>I am very new to swift :/
  I greatly appreciate it!</p>
  
  <p>EDIT: I have fixed a few things, now it breaks at the done function!</p>