UICollectionViewCell в UICollectionView

Из-за того, что используется UICollectionViewCell для формирования блоков, я не могу выставлять автоматическое определение размера высоты блок, только фиксированную.

Каким образом мне пересобрать UICollectionViewCell в UICollectionView, чтобы высота блока была автоматически.

Формирование колонки:

static var createRecentCollectionRow: (([Post], @escaping ((Post) -> Void))
        -> CustomRowFormer<GridCollectionCell>) = { posts, handler in
        return CustomRowFormer<GridCollectionCell>(instantiateType: .Nib(nibName: "GridCollectionCell")) {
            let layout = PinterestLayout()
            layout.columnHeight = 550
            $0.flowLayout = layout
            let dataSource = CollectionArrayDataSource<Post, PostCollectionCell>(collectionView: $0.collectionView, array: posts)
            dataSource.collectionItemSelectionHandler = { indexPath in
                handler(posts[indexPath.row])
            }
            $0.viewDataSource = dataSource
        }.configure {
            $0.rowHeight = UITableView.automaticDimension
        }
    }

Формирование блока в колонке:

class PostCollectionCell: UICollectionViewCell, ConfigurableCell {

    var post: Post?

    @IBOutlet weak var postBackgroundView: UIView!


    override func awakeFromNib() {
        super.awakeFromNib()
    }

    // MARK: - ConfigurableCell
    func configure(_ item: Post, at indexPath: IndexPath) {
        self.postTitleLabel.numberOfLines = 0
        self.postExcerptLabel.numberOfLines = 0
        self.postDateLabel.numberOfLines = 0
    }
}

Текущий результат:

блок с фиксированной высотой такой же блок с фикс высотой


Ответы (0 шт):