Merge branch 'bugfix/tile_container_actionable_children' into 'develop'

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

See merge request BPHV_MIPS/vds_ios!221
This commit is contained in:
Bruce, Matt R 2024-05-06 22:49:24 +00:00
commit da4b37b391

View File

@ -108,9 +108,7 @@ open class TileContainerBase<PaddingType: DefaultValuing>: 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<PaddingType: DefaultValuing>: 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<PaddingType: DefaultValuing>: 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()