Pointer effects

This commit is contained in:
James Magahern
2021-04-19 17:55:24 -07:00
parent 6eb462aeb7
commit 428232bfa8
5 changed files with 28 additions and 1 deletions

View File

@@ -14,6 +14,11 @@ class SegmentedReliefButton: ReliefButton
didSet { children.forEach { addSubview($0) }; setNeedsLayout() }
}
override var isPointerInteractionEnabled: Bool {
set { children.forEach { $0.isPointerInteractionEnabled = newValue } }
get { children.first?.isPointerInteractionEnabled ?? false }
}
private let backgroundsContainerView = UIView(frame: .zero)
private var childrenHighlighObservations: [NSKeyValueObservation] = []
@@ -30,7 +35,8 @@ class SegmentedReliefButton: ReliefButton
}
override var isHighlighted: Bool {
didSet {}
// Does not highlight. Only children do.
set {} get { false }
}
required init?(coder: NSCoder) {