Skip to content

Commit fefcbe7

Browse files
committed
feat(debug-ios): use DebugSwift tools
1 parent 8b65322 commit fefcbe7

File tree

7 files changed

+59
-4
lines changed

7 files changed

+59
-4
lines changed

packages/debug-ios/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @nativescript/debug-ios
22

3-
Advanced iOS debugging made possible via [Flex](https://github.com/FLEXTool/FLEX).
3+
Advanced iOS debugging made possible via [DebugSwift](https://github.com/DebugSwift/DebugSwift).
44

55
```cli
66
npm install @nativescript/debug-ios -D
@@ -14,6 +14,16 @@ import { NativeScriptDebugIOS } from '@nativescript/debug-ios';
1414
NativeScriptDebugIOS.show();
1515
```
1616

17+
## API
18+
19+
### `NativeScriptDebugIOS.show()`
20+
21+
Shows the DebugSwift debugging UI.
22+
23+
### `NativeScriptDebugIOS.toggle()`
24+
25+
Toggles the visibility of the DebugSwift debugging UI.
26+
1727
## License
1828

1929
Apache License Version 2.0

packages/debug-ios/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
export declare class NativeScriptDebugIOS {
2+
/**
3+
* Shows the DebugSwift view. You can call this method from anywhere in your app, and it will be displayed on top of all other views.
4+
*/
25
static show(): void;
6+
7+
/**
8+
* Toggles the DebugSwift view. This could be used to hook up a Shake to Toggle feature in your app, allowing you to show or hide the debug view with a shake gesture.
9+
*/
10+
static toggle(): void;
311
}

packages/debug-ios/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
declare var FLEXManager;
1+
declare var DebugTools: any;
22
export class NativeScriptDebugIOS {
33
static show() {
4-
FLEXManager.sharedManager.showExplorer();
4+
DebugTools.show();
5+
}
6+
7+
static toggle() {
8+
DebugTools.toggle();
59
}
610
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NativeScriptConfig } from '@nativescript/core';
2+
3+
export default {
4+
ios: {
5+
SPMPackages: [
6+
{
7+
name: 'DebugSwift',
8+
libs: ['DebugSwift'],
9+
version: '1.14.0',
10+
repositoryURL: 'https://github.com/DebugSwift/DebugSwift.git',
11+
},
12+
],
13+
},
14+
} as NativeScriptConfig;

packages/debug-ios/platforms/ios/Podfile

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import DebugSwift
2+
import Foundation
3+
4+
@objcMembers
5+
open class DebugTools: NSObject {
6+
static let shared = DebugSwift()
7+
@objc public static func show() {
8+
DispatchQueue.main.async {
9+
shared.setup()
10+
shared.show()
11+
}
12+
}
13+
14+
@objc public static func toggle() {
15+
DispatchQueue.main.async {
16+
shared.toggle()
17+
}
18+
}
19+
}

packages/debug-ios/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"assets": [
1515
"packages/debug-ios/*.md",
1616
"packages/debug-ios/index.d.ts",
17+
"packages/debug-ios/nativescript.config.ts",
1718
"LICENSE",
1819
{
1920
"glob": "**/*",

0 commit comments

Comments
 (0)