title: DidSelectRowAtIndexPath SWIFT
body: <p>I have created a table and a search bar controller with it. I have used a structure to create table contents. I just want to store the data in the selected cell in a variable. I am a new iOS developer.please help :) TIA</p>
  
  <pre><code>//my struct
  
  import Foundation    
  struct areas 
      {
          let name : String
      }
  
  // table contents
  
   override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
          let cell = self.tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
  
        var place :areas
  
          if tableView == self.searchDisplayController!.searchResultsTableView{
  
              place = filteredareas[indexPath.row]
          }
  
          else{
  
              place = places[indexPath.row]
          }
  
          cell.textLabel!.text = place.name
          cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
  
          return cell
      }
  </code></pre>
  
  <p>How to use didSelectRowAtIndexPath to know the contents of cell clicked?</p>