Gabriel Ribeiro Gabriel Ribeiro - 1 month ago 12
Swift Question

UICollectionView inside UICollectionViewCell

I'm struggling to find a way do something like this:
I'm using mostly UICollectionView to make my custom lists. And this time I want to add another UICollectionView inside a UICollectionViewCell.
The Layout is formed by a list of card, containing the informations below and inside it a list of items that came inside the same array.

Any ideias of how should I do this?

P.S: I'm not concerned about performance or something like this. So any idea would be welcome.

List inside another list


I managed to do this in another way. Instead of embed a UICollectionView inside another, I iterated through the array of elements and created subviews above the label.

if let item = info["PRODUTOSITENS"] as? [[String:Any]] {
          for produto in item {
            // All the business logic
                          let DynamicView = UIView(frame: CGRect(x:Double(cell.status.frame.origin.x), y:y, width:Double(collectionView.frame.size.width - 20.0), height:80.0))