Skip to content

Commit

Permalink
interaction changed
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetkgunay committed Jul 11, 2017
1 parent a4eed81 commit d00b527
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions AKGPushAnimator/AKGPushAnimator/AKGInteractionAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public class AKGInteractionAnimator: UIPercentDrivenInteractiveTransition {
transitionInProgress = true
navigationController.popViewController(animated: true)
case .changed:
let const = CGFloat(viewTranslation.x / UIScreen.main.bounds.width)
shouldCompleteTransition = const > 0.4 || velocity.x > UIScreen.main.bounds.width
var const = CGFloat(viewTranslation.x / UIScreen.main.bounds.width * 1.0)
const = min(1.0, max(0.0, const))
shouldCompleteTransition = const > 0.5 || velocity.x > UIScreen.main.bounds.width
update(const)
case .cancelled, .ended:
transitionInProgress = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public class AKGInteractionAnimator: UIPercentDrivenInteractiveTransition {
transitionInProgress = true
navigationController.popViewController(animated: true)
case .changed:
let const = CGFloat(viewTranslation.x / UIScreen.main.bounds.width)
shouldCompleteTransition = const > 0.4 || velocity.x > UIScreen.main.bounds.width
var const = CGFloat(viewTranslation.x / UIScreen.main.bounds.width * 1.0)
const = min(1.0, max(0.0, const))
shouldCompleteTransition = const > 0.5 || velocity.x > UIScreen.main.bounds.width
update(const)
case .cancelled, .ended:
transitionInProgress = false
Expand Down
5 changes: 3 additions & 2 deletions Source/AKGInteractionAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public class AKGInteractionAnimator: UIPercentDrivenInteractiveTransition {
transitionInProgress = true
navigationController.popViewController(animated: true)
case .changed:
let const = CGFloat(viewTranslation.x / UIScreen.main.bounds.width)
shouldCompleteTransition = const > 0.4 || velocity.x > UIScreen.main.bounds.width
var const = CGFloat(viewTranslation.x / UIScreen.main.bounds.width * 1.0)
const = min(1.0, max(0.0, const))
shouldCompleteTransition = const > 0.5 || velocity.x > UIScreen.main.bounds.width
update(const)
case .cancelled, .ended:
transitionInProgress = false
Expand Down

0 comments on commit d00b527

Please sign in to comment.