Digital ACT191 story ONEAPP-7718 - Changed to allow sub uicontrols to take hits.

This commit is contained in:
Scott Pfeil 2024-05-06 18:46:19 -04:00
parent 9b3a9e0589
commit 29a3a4a3a3

View File

@ -108,9 +108,7 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
$0.clipsToBounds = true $0.clipsToBounds = true
} }
private var containerView = View().with { private var containerView = View()
$0.isUserInteractionEnabled = false
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Public Properties // MARK: - Public Properties
@ -119,9 +117,7 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
open var backgroundImage: UIImage? { didSet { setNeedsUpdate() } } open var backgroundImage: UIImage? { didSet { setNeedsUpdate() } }
/// This is the container in which views will be pinned. /// This is the container in which views will be pinned.
open var contentView = View().with { open var contentView = View()
$0.isUserInteractionEnabled = false
}
/// This is the view used to show the high light color for a onClick. /// This is the view used to show the high light color for a onClick.
open var highlightView = View().with { open var highlightView = View().with {
@ -271,6 +267,14 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
clipsToBounds = true 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. /// Resets to default settings.
open override func reset() { open override func reset() {
super.reset() super.reset()