studentdeng лет назад: 12
Родитель
Сommit
6f26164ea3
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      Classes/Global State Explorers/FLEXFileBrowserTableViewController.m

+ 11 - 0
Classes/Global State Explorers/FLEXFileBrowserTableViewController.m

@@ -20,6 +20,7 @@
 @property (nonatomic, strong) NSNumber *searchPathsSize;
 @property (nonatomic, strong) UISearchDisplayController *searchController;
 @property (nonatomic) NSOperationQueue *operationQueue;
+@property (nonatomic, strong) UIDocumentInteractionController *documentController;
 
 @end
 
@@ -247,6 +248,7 @@
             drillInViewController.title = [subpath lastPathComponent];
             [self.navigationController pushViewController:drillInViewController animated:YES];
         } else {
+            [self openFileController:fullPath];
             [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
         }
     } else {
@@ -254,4 +256,13 @@
     }
 }
 
+- (void)openFileController:(NSString *)fullPath
+{
+    UIDocumentInteractionController *controller = [UIDocumentInteractionController new];
+    controller.URL = [[NSURL alloc] initFileURLWithPath:fullPath];
+  
+    [controller presentOptionsMenuFromRect:self.view.bounds inView:self.view animated:YES];
+    self.documentController = controller;
+}
+
 @end