| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,20 +89,9 @@ export module ios { | |||
| 89 | 89 | export const MajorVersion = NSString.stringWithString(UIDevice.currentDevice.systemVersion).intValue; | |
| 90 | 90 | ||
| 91 | 91 | export function openFile(filePath: string): boolean { | |
| 92 | - try { | ||
| 93 | - const appPath = getCurrentAppPath(); | ||
| 94 | - const path = filePath.replace("~", appPath); | ||
| 92 | + console.log("utils.ios.openFile() is deprecated; use utils.openFile() instead"); | ||
| 95 | 93 | ||
| 96 | - const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path)); | ||
| 97 | - controller.delegate = new UIDocumentInteractionControllerDelegateImpl(); | ||
| 98 | - | ||
| 99 | - return controller.presentPreviewAnimated(true); | ||
| 100 | - } | ||
| 101 | - catch (e) { | ||
| 102 | - traceWrite("Error in openFile", traceCategories.Error, traceMessageType.error); | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | - return false; | ||
| 94 | + return openFileAtRootModule(filePath); | ||
| 106 | 95 | } | |
| 107 | 96 | ||
| 108 | 97 | export function getCurrentAppPath(): string { | |
@@ -146,6 +135,26 @@ export module ios { | |||
| 146 | 135 | ||
| 147 | 136 | } | |
| 148 | 137 | ||
| 138 | + export function openFile(filePath: string): boolean { | ||
| 139 | + try { | ||
| 140 | + const appPath = ios.getCurrentAppPath(); | ||
| 141 | + const path = filePath.replace("~", appPath); | ||
| 142 | + | ||
| 143 | + const controller = UIDocumentInteractionController.interactionControllerWithURL(NSURL.fileURLWithPath(path)); | ||
| 144 | + controller.delegate = new UIDocumentInteractionControllerDelegateImpl(); | ||
| 145 | + | ||
| 146 | + return controller.presentPreviewAnimated(true); | ||
| 147 | + } | ||
| 148 | + catch (e) { | ||
| 149 | + traceWrite("Error in openFile", traceCategories.Error, traceMessageType.error); | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + return false; | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + // Need this so that we can use this function inside the ios module (avoid name clashing). | ||
| 156 | + const openFileAtRootModule = openFile; | ||
| 157 | + | ||
| 149 | 158 | export function GC() { | |
| 150 | 159 | __collect(); | |
| 151 | 160 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments