Compare commits

...

4 Commits

Author SHA1 Message Date
Duraid Abdul a522748e3c Merge branch 'main' of https://github.com/duraidabdul/LocalConsole into main 2021-06-22 10:56:58 -07:00
Duraid Abdul 58aecf3a9d Update LCManager.swift 2021-06-22 10:56:56 -07:00
Duraid Abdul 971de252bf Delete Additional Files directory 2021-06-15 12:14:04 -07:00
Duraid Abdul ef0bd6cd8a Offload Demo files 2021-06-15 12:13:45 -07:00
4 changed files with 32 additions and 17 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

+2 -2
View File
@@ -3,8 +3,8 @@
Welcome to LocalConsole! This Swift Package makes on-device debugging easy with a convenient PiP-style console that can display items in the same way ```print()``` will in Xcode. This tool can also dynamically display view frames and restart SpringBoard right from your live app.
<div>
<img src="https://github.com/duraidabdul/LocalConsole/blob/main/Additional%20Files/Demo_Pan.gif?raw=true" width="320">
<img src="https://github.com/duraidabdul/LocalConsole/blob/main/Additional%20Files/Demo_Resize.gif?raw=true" width="320">
<img src="https://github.com/duraidabdul/Demos/blob/main/Demo_Pan.gif?raw=true" width="320">
<img src="https://github.com/duraidabdul/Demos/blob/main/Demo_Resize.gif?raw=true" width="320">
</div>
## **Setup**
+30 -15
View File
@@ -284,25 +284,40 @@ public class LCManager: NSObject, UIGestureRecognizerDelegate {
/// Print items to the console view.
public func print(_ items: Any) {
if consoleTextView.contentOffset.y > consoleTextView.contentSize.height - 20 - consoleTextView.bounds.size.height ||
_hasRelayedOffsetChange == false {
consoleTextView.pendingOffsetChange = true
func performActions() {
if consoleTextView.contentOffset.y > consoleTextView.contentSize.height - 20 - consoleTextView.bounds.size.height ||
_hasRelayedOffsetChange == false {
consoleTextView.pendingOffsetChange = true
_hasRelayedOffsetChange = true
}
_hasRelayedOffsetChange = true
let needsMenuUpdate = consoleTextView.text == ""
let string: String = {
if consoleTextView.text == "" {
return "\(items)"
} else {
return consoleTextView.text + "\n\(items)"
}
}()
setAttributedText(string)
if needsMenuUpdate {
// Update the context menu to show the clipboard/clear actions.
menuButton.menu = makeMenu()
}
}
let string: String = {
if consoleTextView.text == "" {
return "\(items)"
} else {
return consoleTextView.text + "\n\(items)"
// Ensure we are performing UI updates on the main thread.
DispatchQueue.main.async {
// Ensure the console doesn't get caught into any external animation blocks.
UIView.performWithoutAnimation {
performActions()
}
}()
setAttributedText(string)
// Update the context menu to show the clipboard/clear actions.
menuButton.menu = makeMenu()
}
}
/// Clear text in the console view.