iosswiftuitableview

UITableView with cards and list inside


I'm trying to create a custom UITableView to show cards with my items inside, something like this:

Custom UITableView with cards

I already have a class CardView to create my cards with a shadow, but I didn't succeed to use it properly to obtain what I'm looking for.

Maybe the best way to do that is to customise sections and to apply my CardView on them.

Can you help me with that?


Solution

  • Use UITableview inside tableviewcell.

    1.Create UITableView1->UITableviewCell1->UIView->UITableView2->UITableviewCell2

    2.Set UITableview2 delegates in UITableviewCell1 by adding

    override func awakeFromNib() {
        //UITableView2 Delegates
        self.tableView2.delegate = self
        self.tableView2.dataSource = self
        super.awakeFromNib()
    }
    

    3.Reload UITableView2 inside UITableView1 cellforRow