diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 61d7a941..d9e9a02f 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -108,9 +108,7 @@ open class TileContainerBase: Control where Padding $0.clipsToBounds = true } - private var containerView = View().with { - $0.isUserInteractionEnabled = false - } + private var containerView = View() //-------------------------------------------------- // MARK: - Public Properties @@ -119,9 +117,7 @@ open class TileContainerBase: Control where Padding open var backgroundImage: UIImage? { didSet { setNeedsUpdate() } } /// This is the container in which views will be pinned. - open var contentView = View().with { - $0.isUserInteractionEnabled = false - } + open var contentView = View() /// This is the view used to show the high light color for a onClick. open var highlightView = View().with { @@ -271,6 +267,14 @@ open class TileContainerBase: Control where Padding clipsToBounds = true } + /// Overriden to take the hit if there is an onClickSubscriber and the view is not a UIControl + open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + let view = super.hitTest(point, with: event) + guard let _ = onClickSubscriber else { return view } + guard view is UIControl else { return self } + return view + } + /// Resets to default settings. open override func reset() { super.reset()