Skip to content

Commit 4bf7f3f

Browse files
committed
feat: open file in iOS simulator
1 parent e081340 commit 4bf7f3f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

nativescript-core/utils/native-helper.ios.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ function isOrientationLandscape(orientation: number) {
1414
function openFileAtRootModule(filePath: string): boolean {
1515
try {
1616
const appPath = ios.getCurrentAppPath();
17-
const path = filePath.replace("~", appPath);
17+
18+
let path = "";
19+
if (new UIDevice().model === "iPhone Simulator") {
20+
path = filePath;
21+
} else {
22+
path = filePath.replace("~", appPath);
23+
}
1824

1925
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
2026
controller.delegate = new ios.UIDocumentInteractionControllerDelegateImpl();

0 commit comments

Comments
 (0)