chore: default tabs

This commit is contained in:
Nathan Walker
2020-07-09 23:46:02 -07:00
parent 8100cf7089
commit 41f0573d8e
353 changed files with 55344 additions and 55344 deletions

View File

@@ -6,43 +6,43 @@ export * from './utils-common';
export { Source } from './debug';
export function openFile(filePath: string): boolean {
try {
const appPath = ios.getCurrentAppPath();
let path = ios.isRealDevice() ? filePath.replace('~', appPath) : filePath;
try {
const appPath = ios.getCurrentAppPath();
let path = ios.isRealDevice() ? filePath.replace('~', appPath) : filePath;
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
controller.delegate = <UIDocumentInteractionControllerDelegate>new ios.UIDocumentInteractionControllerDelegateImpl();
const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path));
controller.delegate = <UIDocumentInteractionControllerDelegate>new ios.UIDocumentInteractionControllerDelegateImpl();
return controller.presentPreviewAnimated(true);
} catch (e) {
Trace.write('Error in openFile', Trace.categories.Error, Trace.messageType.error);
}
return controller.presentPreviewAnimated(true);
} catch (e) {
Trace.write('Error in openFile', Trace.categories.Error, Trace.messageType.error);
}
return false;
return false;
}
export function GC() {
__collect();
__collect();
}
export function releaseNativeObject(object: NSObject) {
__releaseNativeCounterpart(object);
__releaseNativeCounterpart(object);
}
export function openUrl(location: string): boolean {
try {
const url = NSURL.URLWithString(location.trim());
if (UIApplication.sharedApplication.canOpenURL(url)) {
return UIApplication.sharedApplication.openURL(url);
}
} catch (e) {
// We Don't do anything with an error. We just output it
Trace.write('Error in OpenURL', Trace.categories.Error, Trace.messageType.error);
}
try {
const url = NSURL.URLWithString(location.trim());
if (UIApplication.sharedApplication.canOpenURL(url)) {
return UIApplication.sharedApplication.openURL(url);
}
} catch (e) {
// We Don't do anything with an error. We just output it
Trace.write('Error in OpenURL', Trace.categories.Error, Trace.messageType.error);
}
return false;
return false;
}
export function isRealDevice(): boolean {
return ios.isRealDevice();
return ios.isRealDevice();
}