V
V
Vadym Piatkovskyi2017-12-03 03:28:34
Python
Vadym Piatkovskyi, 2017-12-03 03:28:34

How to make collectionView in tableView?

I know it's a stupid question, but it's not that simple. I have a tableview that has a xib cell that has a collectionView that should also have a xib cell.
The essence of the problem:
I can not reach the collectionView.
The viewcontroller has a tableview. Delegate and date source - we pass it to the view controller.
Where then to pass the collectionView delegate if it is in xib cell? File owner? And work with collectionView in tableview cell implementation file?
I can’t do otherwise, they said that I should do it through custom cells.
I don't understand the principle.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
grinat, 2019-09-19
@grinat

Well, if you need a database, then here's the perfect candidate - https://neo4j.com/
But as for me, the dictionary is enough, and the data can be serialized to json and stored anywhere

D
doublench21, 2017-12-03
@Zinapp

Did not understand you. Well, you have tableviewcell.xib and its accompanying conditional UITableViewCell.swift. It contains a UICollectionView. Now make IBOutlet UICollectionView in UITableViewCell.swift file. Well, you also have collectionviewcell.xib and its accompanying conditional UICollectionViewCell.swift. And let's say one UIViewController.swift controller. You obviously have access to both UITableView and UICollectionView. Now it is enough to specify it in this controller as a delegate for both collections. That's all.
The UITableView is already there as an IBOutlet in your controller.
And IBOutlet UICollectionView is in the UITableViewCell class.
Correct me if you don't understand.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question