Digital PCT265 story PCT-135: Carousel item clipping VDS conditional approach.
This commit is contained in:
parent
c48402a638
commit
54c697dd9d
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -37,4 +37,6 @@
|
||||
/// Containing Views can tell the contained if they should use vertical margins.
|
||||
- (void)shouldSetVerticalMargins:(BOOL)shouldSet;
|
||||
|
||||
- (BOOL)isClippable;
|
||||
|
||||
@end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user