Skip to content

Commit

Permalink
Fixed multi-gesture handling issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mozharovsky committed Nov 26, 2016
1 parent 66b702e commit 9b19183
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/FloatingViewLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public extension FloatingViewLayout {
let location = recognizer.location(in: superview)
let velocity = recognizer.velocity(in: superview)

if case .some(let height) = draggingZone, recognizer.state == .began {
if case let .some(height) = draggingZone, recognizer.state == .began {
if location.y < view.frame.maxY - height {
return
}
Expand Down Expand Up @@ -352,9 +352,13 @@ public extension FloatingViewLayout {
}
}

if recognizer.state == .ended && state == .moved {
if recognizer.state == .ended {
self.previousPoint = nil

guard state == .moved else {
return
}

if abs(velocity.y) >= 1000.0 || crossedEnough(view: view, in: _direction) {
if case .up(_) = _direction {
restore(view: view, to: .folded, animated: true)
Expand All @@ -373,7 +377,6 @@ public extension FloatingViewLayout {
}
}
}

}

}

0 comments on commit 9b19183

Please sign in to comment.