From c0e6436571eb58844f598bc6c3a47a2426b63ba9 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 19 Dec 2022 10:36:31 -0600 Subject: [PATCH] added backgroundImage support Signed-off-by: Matt Bruce --- VDS/Components/TileContainer/TileContainer.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 98a61649..ff7c3bad 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -75,7 +75,11 @@ open class TileContainer: Control { //-------------------------------------------------- // MARK: - Private Properties //-------------------------------------------------- - private var backgroundImageView = UIImageView(frame: .zero) + private var backgroundImageView = UIImageView().with { + $0.translatesAutoresizingMaskIntoConstraints = false + $0.contentMode = .scaleAspectFill + $0.clipsToBounds = true + } private var padding: CGFloat { switch containerPadding { @@ -129,8 +133,11 @@ open class TileContainer: Control { highlightView.isUserInteractionEnabled = false highlightView.isHidden = true highlightView.backgroundColor = .clear - layer.cornerRadius = cornerRadius + //corner radius + layer.cornerRadius = cornerRadius + backgroundImageView.layer.cornerRadius = 8 + } public override func reset() {