title: Add cell to favorites tableview with core data
body: <p>I have an iOS app that I would like to have people swipe on a tableview cell to add that cell to the favorites page tableview.</p>
  
  <p>It would have to use core data so that the favorites save after app exit.</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>This is what I have so far for the cell swipe action:</p>
  
  <pre><code>override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -&gt; [UITableViewRowAction]? {
  
      let favorite = UITableViewRowAction(style: .Normal, title: "Favorite") { (action, indexPath) in
          // share item at indexPath
          self.editing = false
          print("Favorited \(indexPath.row)")
  
  
      }
  
      favorite.backgroundColor = UIColor.greenColor()
  
      return [favorite]
  }
  </code></pre>
  
  <p>This is my code for the favorites page.</p>
  
  <pre><code>var favorites : [String] = []
  
  override func viewDidLoad() {
      super.viewDidLoad()
      favorites = vars.favs
      self.tableView.reloadData()
  }
  
  
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return favorites.count
  }
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
      let object = favorites[indexPath.row]
      cell.textLabel!.text = object 
      return cell
  }
  </code></pre>
  
  <p>This is a picture of how the favorites will be added:
  <a href="https://i.stack.imgur.com/wGB7W.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wGB7W.jpg" alt="Current Progress"></a></p>