MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / openFile

Function openFile

packages/core/utils/index.ios.ts:18–32  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

16export * from './native-helper';
17
18export function openFile(filePath: string): boolean {
19 try {
20 const appPath = iOSUtils.getCurrentAppPath();
21 const path = isRealDevice() ? filePath.replace('~', appPath) : filePath;
22
23 const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
24 controller.delegate = iOSUtils.createUIDocumentInteractionControllerDelegate();
25
26 return controller.presentPreviewAnimated(true);
27 } catch (e) {
28 Trace.write('Error in openFile', Trace.categories.Error, Trace.messageType.error);
29 }
30
31 return false;
32}
33
34export function GC() {
35 __collect();

Callers

nothing calls this directly

Calls 4

isRealDeviceFunction · 0.90
replaceMethod · 0.80
getCurrentAppPathMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected