The task is simple - the supplier’s page for an online store, consists of an image, a name, a brief description of the supplied products (View, constant in size), a description of the supplier itself - can be completely different lengths, respectively, the height of the View also varies and the products that the supplier supplies. Products are implemented in the form of a collectionview , the number may be different. If I were talking about Android, I would have implemented a RecyclerView , in which there would be a header and products, in the case of iOS I ran into a problem.

Actually option was 2:

1) To go by analogy with Android and place in the root collectionView , for which to create two different types of cells. I have already done this, but for cells that are constant in height. In this case, it is necessary to set the automatic size for two different types of cells.

2) Create a scrollView in which to place the entire view, and for the description of the supplier ( UITextView ) and for the products ( UICollectionView ) turn off the scroll so that they stretch in height.

In the first case, I did not find an intelligent solution for how to make an automatic size for different types of cells, at best, I received one column in full screen, while the UITextView was in one row (even though I had all Constrains horizontally and vertically) .

In the second, despite the fact that everything looks up to nausea is simple and for the most part it is drawn as I wanted - for some reason I do not see the UIollectionView . DataSource and Delegate are specified, after loading the products (they are loaded at the start of the page), I forcibly call reloadData() and setNeedsLayout() . Constrains are spelled out in such a way that the UICollectionView is definitely under the UITextView , but there is no result.

I would like to ask advice, how would you implement such a page? If there are no other options, then please suggest that you can try to solve my problem for any of the options.

  • Can it be easier to otdebazhit your missing UICollectionView? - Max Mikheyenko
  • That would be great, but I can't understand what's wrong. First of all, main.stroyboard - constraints are specified correctly, and in the right places. DataSource and Delegate are listed in the storyboard and, after a lack of result, are duplicated in the controller code. I always get products in the number> 1. I defined cellForItemAtIndexPath, numberOfItemsInSection (based on the number of products / 2), numberOfSectionsInCollectionView (= 2). What could I forget? - iamthevoid

0