title: UICollectionViewCompositionalLayout equal item height using autolayout
body: <p>I'm using a UICollectionViewCompositionalLayout to create a grid. Each cell contains a multi-line label. My goal is that, when 1 item in a group/row grows, all others in that group/row grow to the same height e.g. in the attached pic, I would like the cells in column 2 and 3, row 2, to match the height of the first cell that contains (&quot;1000\ndetail&quot;).
  <a href="https://i.stack.imgur.com/ZT7l5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZT7l5.png" alt="enter image description here" /></a></p>
  <p>I have tried various things like setting the height of the items to fractional(1) but that then prevented multi line. Other attempts such as changing the dimensions of the group did not help either. How can I set up my UICollectionViewCompositionalLayout to achieve my goal please?</p>
  <p>Collection View:</p>
  <pre><code>NSCollectionLayoutSize *itemSize = [NSCollectionLayoutSize sizeWithWidthDimension:[NSCollectionLayoutDimension fractionalWidthDimension:0.333] heightDimension:[NSCollectionLayoutDimension fractionalHeightDimension:1]];
  NSCollectionLayoutItem *item = [NSCollectionLayoutItem itemWithLayoutSize:itemSize];
  
  NSCollectionLayoutSize *groupSize = [NSCollectionLayoutSize sizeWithWidthDimension:[NSCollectionLayoutDimension fractionalWidthDimension:1] heightDimension:[NSCollectionLayoutDimension estimatedDimension:40]];
  NSCollectionLayoutGroup *group = [NSCollectionLayoutGroup horizontalGroupWithLayoutSize:groupSize subitem:item count:3];
  
  NSCollectionLayoutSection *section = [NSCollectionLayoutSection sectionWithGroup:group];
  UICollectionViewCompositionalLayout *compositionalLayout = [[UICollectionViewCompositionalLayout alloc] initWithSection:section];
  
  UICollectionView *cv = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:compositionalLayout];
  cv.translatesAutoresizingMaskIntoConstraints = NO;
  cv.dataSource = self;
  cv.delegate = self;
  [self.view addSubview:cv];
  
  [cv registerClass:[GridCVCell class] forCellWithReuseIdentifier:@&quot;Cell&quot;];
  
  [cv.topAnchor constraintEqualToAnchor:self.view.topAnchor constant:100].active = YES;
  [cv.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:0].active = YES;
  [cv.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:0].active = YES;
  [cv.heightAnchor constraintEqualToConstant:300].active = YES;
  </code></pre>
  <p>CollectionViewCell</p>
  <pre><code>- (instancetype)initWithFrame:(CGRect)frame {
      
      if ([super initWithFrame:frame]) {
    
          UILabel *titleL = [UIlabel new];
          titleL.translatesAutoresizingMaskIntoConstraints = NO;
          [self.contentView addSubview:titleL];
  
          [titleL.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor constant:10].active = YES;
          [titleL.trailingAnchor constraintEqualToAnchor:self.contentView.trailingAnchor constant:-10].active = YES;
          [titleL.centerYAnchor constraintEqualToAnchor:self.contentView.centerYAnchor constant:-2].active = YES;
          
          [self.contentView.heightAnchor constraintEqualToAnchor:titleL.heightAnchor constant:10].active = YES;
      }
      
      return self;
  }
  </code></pre>