From 17883b78530f56c3f695e9dfc56aad3c9c039ebe Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 27 Mar 2024 14:41:21 -0500 Subject: [PATCH] added compression/hugging Signed-off-by: Matt Bruce --- VDS/Components/Breadcrumbs/BreadcrumbCellItem.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Breadcrumbs/BreadcrumbCellItem.swift b/VDS/Components/Breadcrumbs/BreadcrumbCellItem.swift index 939f7573..bd04304c 100644 --- a/VDS/Components/Breadcrumbs/BreadcrumbCellItem.swift +++ b/VDS/Components/Breadcrumbs/BreadcrumbCellItem.swift @@ -24,6 +24,8 @@ final class BreadcrumbCellItem: UICollectionViewCell { $0.distribution = .fill $0.alignment = .fill $0.spacing = VDSLayout.Spacing.space1X.value + $0.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) + $0.setContentHuggingPriority(.defaultHigh, for: .horizontal) } }() @@ -67,7 +69,9 @@ final class BreadcrumbCellItem: UICollectionViewCell { //update surface separator.surface = surface breadCrumbItem.surface = surface - + breadCrumbItem.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) + breadCrumbItem.setContentHuggingPriority(.defaultLow, for: .horizontal) + //remove previous views stackView.arrangedSubviews.forEach { $0.removeFromSuperview() } @@ -79,7 +83,6 @@ final class BreadcrumbCellItem: UICollectionViewCell { //update separator separator.textColor = textColorConfiguration.getColor(surface) separator.isHidden = hideSlash - self.breadCrumbItem = breadCrumbItem layoutIfNeeded() }