From 7920272bff16675b298db4fcf752afee79daf811 Mon Sep 17 00:00:00 2001 From: Duraid Abdul Date: Mon, 6 Sep 2021 16:49:56 -0600 Subject: [PATCH] Update LCManager.swift --- Sources/LocalConsole/LCManager.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/LocalConsole/LCManager.swift b/Sources/LocalConsole/LCManager.swift index 2ce95c8..45bd8e4 100644 --- a/Sources/LocalConsole/LCManager.swift +++ b/Sources/LocalConsole/LCManager.swift @@ -832,13 +832,15 @@ public class LCManager: NSObject, UIGestureRecognizerDelegate { switch recognizer.state { case .changed: - consoleView.center.x = initialViewLocation.x + translation.x - consoleView.center.y = initialViewLocation.y + translation.y + UIViewPropertyAnimator(duration: 0.175, dampingRatio: 1) { [self] in + consoleView.center = CGPoint(x: initialViewLocation.x + translation.x, + y: initialViewLocation.y + translation.y) + }.startAnimation() if consoleView.frame.maxX > 30 && consoleView.frame.minX < UIScreen.portraitSize.width - 30 { - self.grabberMode = false + grabberMode = false } else { - self.grabberMode = true + grabberMode = true } case .ended, .cancelled: