Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Carrying on data from a UITableView cell to another VC's tableview? (Swift)

I'm currently working on a project in swift where I have created a ViewController which has a UITableView. This UITableView you can swipe to delete. I'm wanting to make a 'Deleted items' or 'Recycle bin' section kind of thing on my other view where once the delete button is pressed it deletes from the first tableView and is now inserted into the 'Deleted items' view tableview cell. *Also: I want this data when it is moved to 'Deleted items' to still be saved that is stored in the project created. How can I do this?

*Edit:

I've been thinking, I would make another array for the recycled items. In your UITableViewRowAction handler for deleting items, once you remove something out of your projects array, you add it to your recycled array. Then pass that recycled array over to the other VC in prepareForSegue method, and the other VC will load that array into the table.

How could I remove and add to other table tho?

First view code: pastebin.com/dBucJ9w0 View: prntscr.com/5wft7u Thanks.

Have you played with NSUserDefaults? Handy way of passing info between classes/VCs