@@ -89,20 +89,9 @@ export module ios {
8989 export const MajorVersion = NSString . stringWithString ( UIDevice . currentDevice . systemVersion ) . intValue ;
9090
9191 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" ) ;
9593
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 ) ;
10695 }
10796
10897 export function getCurrentAppPath ( ) : string {
@@ -146,6 +135,26 @@ export module ios {
146135
147136}
148137
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+
149158export function GC ( ) {
150159 __collect ( ) ;
151160}
0 commit comments