Compare commits

..

18 Commits

Author SHA1 Message Date
Duraid Abdul 2c5d5e018a Fix share sheet crash 2022-12-04 16:19:33 -07:00
Duraid Abdul 6413eb8a81 Add a custom menu to the console’s menu 2022-11-21 23:44:08 -07:00
Duraid Abdul 1dcb6e3a57 Fix build failure 2022-10-16 19:21:53 -06:00
Duraid Abdul bfc3bc4fd2 Updated action icons, removed ConsoleWindow. 2022-10-16 19:09:36 -06:00
Duraid Abdul 74556927be Fix crash when invoking keyboard early 2022-10-15 12:49:16 -06:00
Duraid Abdul fee9e30df9 Fix simulator crash 2022-10-15 12:48:52 -06:00
Duraid Abdul 5e2b5feca4 Fix blocked touches on iPad 2022-10-15 12:48:23 -06:00
Duraid Abdul 3ffdde8904 Fix Xcode 13 build failure 2022-09-20 10:39:18 -06:00
Duraid Abdul 63ebc8ed31 Fix border view frame 2022-09-18 23:39:48 -06:00
Duraid Abdul 64e18b18fc Fix keybaord avoidance 2022-09-18 23:31:00 -06:00
Duraid Abdul 9dcfa5accd iPhone 14 Pro support 2022-09-18 21:05:11 -06:00
Duraid Abdul adbb2d763f Update README.md 2022-05-14 19:15:47 -07:00
Duraid Abdul c08c26f4a7 Update README.md 2022-05-14 19:15:18 -07:00
Duraid Abdul d995119198 Update LCManager.swift 2022-02-01 12:26:52 -08:00
Duraid Abdul b4d7c06432 Update LCManager.swift 2022-01-26 21:02:54 -08:00
Duraid Abdul a7b95a4379 Update LCManager.swift 2022-01-26 02:18:26 -08:00
Duraid Abdul 3efe25f804 Update LCManager.swift 2022-01-25 17:15:30 -08:00
Duraid Abdul 0a3e28b28f Animation Improvements 2022-01-24 23:09:49 -08:00
3 changed files with 425 additions and 287 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ Welcome to LocalConsole! This Swift Package makes on-device debugging easy with
2. Paste the following into the URL field: https://github.com/duraidabdul/LocalConsole/
3. Once the package dependancy has been added, import LocalConsole and create an easily accessible global instance of ```Console.shared```.
3. Once the package dependancy has been added, import LocalConsole and create an easily accessible global instance of ```LCManager.shared```.
```swift
import LocalConsole
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -15,7 +15,7 @@ class ResizeController {
lazy var platterView = PlatterView(frame: .zero)
var consoleCenterPoint: CGPoint {
let containerViewSize = LCManager.shared.viewController.view.frame.size
let containerViewSize = LCManager.shared.consoleViewController.view.frame.size
return CGPoint(x: (containerViewSize.width * UIScreen.main.scale / 2).rounded() / UIScreen.main.scale,
y: (containerViewSize.height * UIScreen.main.scale / 2).rounded() / UIScreen.main.scale
@@ -50,7 +50,7 @@ class ResizeController {
lazy var bottomGrabber: UIView = {
let view = UIView()
LCManager.shared.consoleWindow?.addSubview(view)
LCManager.shared.consoleViewController.view.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
@@ -80,7 +80,7 @@ class ResizeController {
lazy var rightGrabber: UIView = {
let view = UIView()
LCManager.shared.consoleWindow?.addSubview(view)
LCManager.shared.consoleViewController.view.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
@@ -117,7 +117,7 @@ class ResizeController {
_ = rightGrabber
// Ensure initial autolayout is performed unanimated.
LCManager.shared.consoleWindow?.layoutIfNeeded()
LCManager.shared.consoleViewController.view.layoutIfNeeded()
if #available(iOS 15, *) {
FrameRateRequest.shared.perform(duration: 1.5)
@@ -138,17 +138,17 @@ class ResizeController {
}
// Ensure background color animates in right the first time.
LCManager.shared.consoleWindow?.backgroundColor = .clear
LCManager.shared.consoleViewController.view.backgroundColor = .clear
UIViewPropertyAnimator(duration: 0.6, dampingRatio: 1) {
LCManager.shared.consoleView.center = self.consoleCenterPoint
// Update grabbers (layout constraints)
LCManager.shared.consoleWindow?.layoutIfNeeded()
LCManager.shared.consoleViewController.view.layoutIfNeeded()
LCManager.shared.menuButton.alpha = 0
LCManager.shared.consoleWindow?.backgroundColor = UIColor(dynamicProvider: { traitCollection in
LCManager.shared.consoleViewController.view.backgroundColor = UIColor(dynamicProvider: { traitCollection in
UIColor(white: 0, alpha: traitCollection.userInterfaceStyle == .light ? 0.1 : 0.3)
})
}.startAnimation()
@@ -181,11 +181,11 @@ class ResizeController {
LCManager.shared.snapToCachedEndpoint()
// Update grabbers (layout constraints)
LCManager.shared.consoleWindow?.layoutIfNeeded()
LCManager.shared.consoleViewController.view.layoutIfNeeded()
LCManager.shared.menuButton.alpha = 1
LCManager.shared.consoleWindow?.backgroundColor = .clear
LCManager.shared.consoleViewController.view.backgroundColor = .clear
}.startAnimation()
UIViewPropertyAnimator(duration: 0.2, dampingRatio: 1) { [self] in
@@ -277,7 +277,7 @@ class ResizeController {
LCManager.shared.consoleView.center.y = self.consoleCenterPoint.y
// Animate autolayout updates.
LCManager.shared.consoleWindow?.layoutIfNeeded()
LCManager.shared.consoleViewController.view.layoutIfNeeded()
}.startAnimation()
UIViewPropertyAnimator(duration: 0.4, dampingRatio: 1) { [self] in
@@ -358,7 +358,7 @@ class ResizeController {
LCManager.shared.consoleView.center.x = (UIScreen.main.nativeBounds.width * 1/2).rounded() / UIScreen.main.scale
// Animate autolayout updates.
LCManager.shared.consoleWindow?.layoutIfNeeded()
LCManager.shared.consoleViewController.view.layoutIfNeeded()
}.startAnimation()
UIViewPropertyAnimator(duration: 0.4, dampingRatio: 1) { [self] in
@@ -396,8 +396,8 @@ class PlatterView: UIView {
addSubview(blurView)
LCManager.shared.viewController.view.addSubview(self)
LCManager.shared.viewController.view.sendSubviewToBack(self)
LCManager.shared.consoleViewController.view.addSubview(self)
LCManager.shared.consoleViewController.view.sendSubviewToBack(self)
_ = backgroundButton
@@ -466,8 +466,8 @@ class PlatterView: UIView {
self.dismiss()
}))
backgroundButton.frame.size = CGSize(width: self.frame.size.width, height: possibleEndpoints[0].y + 30)
LCManager.shared.consoleWindow?.addSubview(backgroundButton)
LCManager.shared.consoleWindow?.sendSubviewToBack(backgroundButton)
LCManager.shared.consoleViewController.view.addSubview(backgroundButton)
LCManager.shared.consoleViewController.view.sendSubviewToBack(backgroundButton)
return backgroundButton
}()
@@ -525,7 +525,7 @@ class PlatterView: UIView {
LCManager.shared.consoleSize = LCManager.shared.defaultConsoleSize
LCManager.shared.lumaHeightAnchor.constant = LCManager.shared.defaultConsoleSize.height
LCManager.shared.consoleView.center = ResizeController.shared.consoleCenterPoint
LCManager.shared.consoleWindow?.layoutIfNeeded()
LCManager.shared.consoleViewController.view.layoutIfNeeded()
}.startAnimation()
}), for: .touchUpInside)
@@ -544,7 +544,7 @@ class PlatterView: UIView {
}()
func configureFrame() {
self.frame.size = LCManager.shared.viewController.view.frame.size
self.frame.size = LCManager.shared.consoleViewController.view.frame.size
// Make sure bottom doesn't show on upwards pan.
self.frame.size.height += 50
self.frame.origin = possibleEndpoints[1]
@@ -593,7 +593,7 @@ class PlatterView: UIView {
}
var possibleEndpoints: [CGPoint] { return [CGPoint(x: 0, y: (UIScreen.hasRoundedCorners ? 44 : -8) + 63),
CGPoint(x: 0, y: LCManager.shared.viewController.view.frame.size.height + 5)]
CGPoint(x: 0, y: LCManager.shared.consoleViewController.view.frame.size.height + 5)]
}
var initialPlatterOriginY = CGFloat.zero