Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 245d69679d | |||
| 7920272bff | |||
| 6892a19b0e | |||
| d2d45f8e03 |
@@ -24,10 +24,10 @@ let consoleManager = LCManager.shared
|
||||
Once prepared, the localConsole can be used throughout your project.
|
||||
```swift
|
||||
|
||||
// Show the console view.
|
||||
// Activate the console view.
|
||||
consoleManager.isVisible = true
|
||||
|
||||
// Hide the console view.
|
||||
// Deactivate the console view.
|
||||
consoleManager.isVisible = false
|
||||
```
|
||||
|
||||
|
||||
@@ -217,20 +217,20 @@ public class LCManager: NSObject, UIGestureRecognizerDelegate {
|
||||
|
||||
// Left edge hiding endpoints.
|
||||
if consoleView.center.y < (UIScreen.portraitSize.height - (temporaryKeyboardHeightValueTracker ?? 0)) / 2 {
|
||||
endpoints.append(CGPoint(x: -consoleSize.width / 2 + 10,
|
||||
endpoints.append(CGPoint(x: -consoleSize.width / 2 + 28,
|
||||
y: endpoints[0].y))
|
||||
} else {
|
||||
endpoints.append(CGPoint(x: -consoleSize.width / 2 + 10,
|
||||
endpoints.append(CGPoint(x: -consoleSize.width / 2 + 28,
|
||||
y: endpoints[1].y))
|
||||
}
|
||||
} else if consoleView.frame.maxX >= UIScreen.portraitSize.width {
|
||||
|
||||
// Right edge hiding endpoints.
|
||||
if consoleView.center.y < (UIScreen.portraitSize.height - (temporaryKeyboardHeightValueTracker ?? 0)) / 2 {
|
||||
endpoints.append(CGPoint(x: UIScreen.portraitSize.width + consoleSize.width / 2 - 10,
|
||||
endpoints.append(CGPoint(x: UIScreen.portraitSize.width + consoleSize.width / 2 - 28,
|
||||
y: endpoints[0].y))
|
||||
} else {
|
||||
endpoints.append(CGPoint(x: UIScreen.portraitSize.width + consoleSize.width / 2 - 10,
|
||||
endpoints.append(CGPoint(x: UIScreen.portraitSize.width + consoleSize.width / 2 - 28,
|
||||
y: endpoints[1].y))
|
||||
}
|
||||
}
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user