diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 72ef86d0..62e96890 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -266,6 +266,15 @@ open class TileContainerBase: Control where Padding containerView.bridge_isAccessibilityElementBlock = { [weak self] in self?.onClickSubscriber != nil } containerView.accessibilityHint = "Double tap to open." containerView.accessibilityLabel = nil + + NotificationCenter.default + .publisher(for: UIDevice.orientationDidChangeNotification) + .sink() { [weak self] _ in + DispatchQueue.main.asyncAfter(deadline: .now() + 0.001) { [weak self] in + guard let self else { return } + setNeedsUpdate() + } + }.store(in: &subscribers) } @@ -423,7 +432,7 @@ open class TileContainerBase: Control where Padding heightConstraint?.activate() } } - + private func updateContainerView() { applyBackgroundEffects() @@ -469,8 +478,8 @@ open class TileContainerBase: Control where Padding } else { containerView.applyAlignment(distribution == .fill ? .fill : alignment) - if let superview, distribution == .fill, !isPinnedHorizontallyToSuperview() { - sizeContainerView(width: superview.frame.size.width) + if distribution == .fill, !isPinnedHorizontallyToSuperview(), let size = horizontalPinnedSize() { + sizeContainerView(width: size.width) } } }