Explorar el Código

Merge pull request #23 from studentdeng/develop

add a default File Browser
Ryan Olson hace 12 años
padre
commit
27377415a8

+ 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