not dismiss selector on first time slide
This commit is contained in:
parent
a96e1803b0
commit
02cce73f42
|
@ -172,13 +172,16 @@ public final class ReactionButton: UIReactionControl {
|
|||
if gestureRecognizer.state == .changed {
|
||||
isLongPressMoved = true
|
||||
|
||||
selector.longPressAction(gestureRecognizer)
|
||||
_ = selector.longPressAction(gestureRecognizer)
|
||||
}
|
||||
else if gestureRecognizer.state == .ended {
|
||||
if isLongPressMoved {
|
||||
selector.longPressAction(gestureRecognizer)
|
||||
|
||||
dismissReactionSelector()
|
||||
let isPointInside = selector.longPressAction(gestureRecognizer)
|
||||
if (isPointInside) {
|
||||
dismissReactionSelector()
|
||||
} else {
|
||||
displayReactionSelector(feedback: .tapToSelectAReaction)
|
||||
}
|
||||
}
|
||||
else {
|
||||
selector.feedback = .tapToSelectAReaction
|
||||
|
|
|
@ -186,7 +186,7 @@ public final class ReactionSelector: UIReactionControl {
|
|||
|
||||
// MARK: - Responding to Gesture Events
|
||||
|
||||
@objc func longPressAction(_ gestureRecognizer: UIGestureRecognizer) {
|
||||
@objc func longPressAction(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||
let location = gestureRecognizer.location(in: self)
|
||||
let touchIndex = optionIndexFromPoint(location)
|
||||
let needsUpdate = touchIndex != stateHighlightedReactionIndex
|
||||
|
@ -226,6 +226,8 @@ public final class ReactionSelector: UIReactionControl {
|
|||
sendActions(for: isPointInsideExtendedBounds(location) ? .touchUpInside : .touchUpOutside)
|
||||
}
|
||||
}
|
||||
|
||||
return isPointInsideExtendedBounds(location)
|
||||
}
|
||||
|
||||
// MARK: - Locating Points
|
||||
|
|
Loading…
Reference in New Issue