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

Function openFileAtRootModule

packages/core/utils/native-helper.ios.ts:127–141  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

125}
126
127function openFileAtRootModule(filePath: string): boolean {
128 try {
129 const appPath = getCurrentAppPath();
130 const path = isRealDevice() ? filePath.replace('~', appPath) : filePath;
131
132 const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
133 controller.delegate = createUIDocumentInteractionControllerDelegate();
134
135 return controller.presentPreviewAnimated(true);
136 } catch (e) {
137 Trace.write('Error in openFile', Trace.categories.Error, Trace.messageType.error);
138 }
139
140 return false;
141}
142// TODO: remove for NativeScript 9.0
143export function getter<T>(_this: any, property: T | { (): T }): T {
144 console.log('utils.ios.getter() is deprecated; use the respective native property instead');

Callers 1

openFileFunction · 0.85

Calls 5

replaceMethod · 0.80
getCurrentAppPathFunction · 0.70
isRealDeviceFunction · 0.70
writeMethod · 0.65

Tested by

no test coverage detected