TableView inside TableVIew

Im new in Swift, but I have an assigment for a class, and I could use some help.
So, basically I want to build a tableView inside the cell of another tableView, but i dont know how to pass the data from the other viewController.
Lets say I have a class named Day, with 2 attributes: Tittle and an array String named Places, i have a view controller that helps me build that Places array, and it passes onto another view controller thats supposed to create a instance Day() with the array and any title, then i want the other view controller to show a table view with the Days and inside each day its Places.
But im really lost, and when I try to do it, the data is passing but the table view is empty. And it doesnt add anything to my Day() array.

I dont know if I made myself clear enough, sorry.
Please please please help

Welcome to the community Valentina!

Could you draw out what you mean? I’m not getting the whole picture.

Also putting a table view inside of another tableView is very odd. I’m guessing what you actually mean is when you click on one cell. You’ll be brought to another controller, and this controller has a table view?

Are you trying to create something similar to iOS settings: Settings -> General -> About ???

This is what I have in my mind, I dont know how to do it.

Okay, I’m still not completely sure how that works.

But what you’ll want to do is create a table view. Add a tableView cell, and then begin customizing that cell

Your plus button (for adding a new one) that can be done on a different view controller

If you want to add a new record to Days, then Mikaela is pointing you in the correct direction. She is good! This is what your picture looks like to me.

If you want to create new records in your second ViewController let us know, as that is a completely different process. Also, are you saving persistent data somewhere? If so you can call on that to pass into a new VC.


1 Like