refactored to a View instead of Control
implemented isHighlighted Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
e0d769ccf3
commit
0434b3f63e
@ -44,7 +44,7 @@ open class TileContainer: TileContainerBase<TileContainer.Padding> {
|
||||
}
|
||||
}
|
||||
|
||||
open class TileContainerBase<PaddingType: DefaultValuing>: Control where PaddingType.ValueType == CGFloat {
|
||||
open class TileContainerBase<PaddingType: DefaultValuing>: View where PaddingType.ValueType == CGFloat {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
@ -118,6 +118,8 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
|
||||
$0.setContentCompressionResistancePriority(.defaultHigh, for: .vertical)
|
||||
}
|
||||
|
||||
private var isHighlighted: Bool = false { didSet { setNeedsUpdate() } }
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
@ -337,6 +339,27 @@ open class TileContainerBase<PaddingType: DefaultValuing>: Control where Padding
|
||||
set {}
|
||||
}
|
||||
|
||||
open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||
super.touchesBegan(touches, with: event)
|
||||
if let onClickSubscriber {
|
||||
isHighlighted = true
|
||||
}
|
||||
}
|
||||
|
||||
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||
super.touchesEnded(touches, with: event)
|
||||
if let onClickSubscriber {
|
||||
isHighlighted = false
|
||||
}
|
||||
}
|
||||
|
||||
open override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||
super.touchesCancelled(touches, with: event)
|
||||
if let onClickSubscriber {
|
||||
isHighlighted = false
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Methods
|
||||
//--------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user