Skip to content

Commit

Permalink
fix transition x logic
Browse files Browse the repository at this point in the history
  • Loading branch information
horitaku46 committed Mar 14, 2018
1 parent 105d94c commit e8c9f69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions BlowinSwiper/BlowinSwiper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final class BlowinSwiper: NSObject {
case .began:
// only right swipe
let isZeroTransitionY = isLowSensitivity ? translation.y == 0 : true
if velocity.x > 0 && isZeroTransitionY {
if translation.x > 0 && isZeroTransitionY {
isInteractivePop = true
navigationController?.popViewController(animated: true)
}
Expand All @@ -61,8 +61,8 @@ public final class BlowinSwiper: NSObject {

case .ended, .cancelled:
isInteractivePop = false
let halfWidth = view.bounds.width / 3
velocity.x > Const.maxSwipeVelocityX || translation.x > halfWidth ? percentDriven.finish() : percentDriven.cancel()
let maxWidth = view.bounds.width / 3
velocity.x > Const.maxSwipeVelocityX || translation.x > maxWidth ? percentDriven.finish() : percentDriven.cancel()

default:
break
Expand Down
2 changes: 1 addition & 1 deletion Example/Sources/Controllers/Menu/MenuViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class MenuViewController: UIViewController, BlowinSwipeable {
// Enable scrolling by putting finger back during swipe back
swipeMenuView.contentScrollView?.isScrollEnabled = true

configureSwipeBack()
configureSwipeBack(isLowSensitivity: true)
enabledRecognizeSimultaneously(scrollView: swipeMenuView.contentScrollView)
}

Expand Down

0 comments on commit e8c9f69

Please sign in to comment.