@@ -10,14 +10,16 @@ export class ShareFile {
1010 }
1111 }
1212
13+ private controller : UIDocumentInteractionController ;
14+
1315 open ( args : any ) : boolean {
1416 if ( args . path ) {
1517 try {
1618 const appPath = this . getCurrentAppPath ( ) ;
1719 const path = args . path . replace ( "~" , appPath ) ;
1820
19- const controller = UIDocumentInteractionController . interactionControllerWithURL ( NSURL . fileURLWithPath ( path ) ) ;
20- controller . delegate = new UIDocumentInteractionControllerDelegateImpl2 ( ) ;
21+ this . controller = UIDocumentInteractionController . interactionControllerWithURL ( NSURL . fileURLWithPath ( path ) ) ;
22+ this . controller . delegate = new UIDocumentInteractionControllerDelegateImpl2 ( ) ;
2123
2224 let rect ;
2325 if ( args . rect ) {
@@ -26,16 +28,16 @@ export class ShareFile {
2628 rect = CGRectMake ( 0 , 0 , 0 , 0 ) ;
2729 }
2830
29- if ( args . options ) {
30- return controller . presentOptionsMenuFromRectInViewAnimated (
31+ if ( args . options ) {
32+ return this . controller . presentOptionsMenuFromRectInViewAnimated (
3133 rect ,
32- controller . delegate . documentInteractionControllerViewForPreview ( controller ) ,
34+ this . controller . delegate . documentInteractionControllerViewForPreview ( this . controller ) ,
3335 args . animated ? true : false
3436 ) ;
3537 } else {
36- return controller . presentOpenInMenuFromRectInViewAnimated (
38+ return this . controller . presentOpenInMenuFromRectInViewAnimated (
3739 rect ,
38- controller . delegate . documentInteractionControllerViewForPreview ( controller ) ,
40+ this . controller . delegate . documentInteractionControllerViewForPreview ( this . controller ) ,
3941 args . animated ? true : false
4042 ) ;
4143 }
0 commit comments