Adding a container view to a UICollectionViewCell

I am trying to add a container view to a UICollectionViewCell in an interface builder, but Xcode throws an error: Illegal Configuration: Container Views cannot be placed in elements that are repeated at runtime. Will creating a static UICollectionViewCell solve this problem? If so, how would you make a static UICollectionViewCell?

+5
source share
1 answer

What I think you are trying to do is put the UIViewController into a dynamically created UITableViewCell. If so, it is not possible if the generated cell is dynamic. If you know a priori that cells will always have a fixed number, you can generate them using the interface builder by setting the cells to static.

If instead you want to add a container view to your cell to place other objects in it, you need to add a UIView object, not a UIViewController.

+3
source

Source: https://habr.com/ru/post/1211021/


All Articles