Digital PCT265 story PCT-135: Carousel item clipping VDS conditional approach.

This commit is contained in:
Hedden, Kyle Matthew 2024-05-23 16:18:46 -04:00
parent c48402a638
commit 54c697dd9d
4 changed files with 20 additions and 1 deletions

View File

@ -136,4 +136,8 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{
extension TileContainer: MVMCoreUIViewConstrainingProtocol {
public func horizontalAlignment() -> UIStackView.Alignment { .leading }
public func isClippable() -> Bool {
return false
}
}

View File

@ -134,3 +134,13 @@ open class Tilelet: VDS.Tilelet, VDSMoleculeViewProtocol{
}
}
}
extension Tilelet: MVMCoreUIViewConstrainingProtocol {
// Investigate later.
//public func horizontalAlignment() -> UIStackView.Alignment { .leading }
public func isClippable() -> Bool {
return false
}
}

View File

@ -7,6 +7,7 @@
//
import Foundation
import VDS
open class CarouselItem: MoleculeCollectionViewCell, CarouselItemProtocol {
@ -17,12 +18,14 @@ open class CarouselItem: MoleculeCollectionViewCell, CarouselItemProtocol {
open override func addMolecule(_ molecule: MoleculeViewProtocol) {
super.addMolecule(molecule)
clipsToBounds = (molecule as? MVMCoreUIViewConstrainingProtocol)?.isClippable?() ?? true
contentView.sendSubviewToBack(molecule)
}
open override func setupView() {
super.setupView()
clipsToBounds = true // Needed for container view corner rounding of subviews.
// Covers the card when peaking.
peakingCover.backgroundColor = .white

View File

@ -37,4 +37,6 @@
/// Containing Views can tell the contained if they should use vertical margins.
- (void)shouldSetVerticalMargins:(BOOL)shouldSet;
- (BOOL)isClippable;
@end