Преглед на файлове

1.下载到文件app的

huangxiaodong преди 1 година
родител
ревизия
305a54ec5e

+ 1 - 0
创维盒子/双子星云手机/AppDelegate/AppDelegate.h

@@ -12,6 +12,7 @@
 @interface AppDelegate : UIResponder <UIApplicationDelegate>
 
 @property (nonatomic, strong) UIWindow *window;
+@property (nonatomic, strong) UITabBarController *mainTabBar;
 
 //进入云手机后拿到的云手机分辨率  h264课指定 720.0 1280.0
 @property (nonatomic, assign)CGFloat couldPhone_W_PHONE;

+ 1 - 1
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -406,7 +406,7 @@
 
     [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor hwColor:@"#01B7EA"],NSForegroundColorAttributeName, [UIFont systemFontOfSize:12.0],NSFontAttributeName,nil] forState:UIControlStateSelected];
     
-    
+    ksharedAppDelegate.mainTabBar = tabBarController;
     self.window.rootViewController = tabBarController;
     [self.window makeKeyAndVisible];
 }

+ 1 - 1
创维盒子/双子星云手机/cloudPhone/webSocketManager+downloadFile.h

@@ -9,7 +9,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface webSocketManager (downloadFile)
+@interface webSocketManager (downloadFile)<UIDocumentPickerDelegate>
 - (void)begindownloadFileFunBy:(couldPhoneFileModel *)couldPhoneFileMod;
 - (void)downloadFileFunServiceResponseFun:(NSData *)fileData with:(BOOL)isDownloadDone;
 - (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls;

+ 20 - 17
创维盒子/双子星云手机/cloudPhone/webSocketManager+downloadFile.m

@@ -220,23 +220,26 @@
 - (void)loadOtherDataFinished
 {
     HLog(@"\n\n\n\n\n\n\n\n没有处理 loadOtherDataFinished \n\n\n\n\n\n\n\n");
-//    [[downloadManager shareInstance] DownloadFileDoneOneFileFun];
-//    
-//    NSString *fileName = [self.curDownloadFileModel getFileNameFun];
-//    NSString*filePath = [cachesFileManager getFilePathWithName:fileName type:DownLoadFileType];
-//    
-//    if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]){
-//        HLog(@"没有找到文件:%@",fileName);
-//        return;
-//    }
-//    
-//    NSURL * fileURL = [NSURL fileURLWithPath:filePath];
-//    UIDocumentPickerViewController *documentPickerVC = [[UIDocumentPickerViewController alloc] initWithURL:fileURL inMode:UIDocumentPickerModeExportToService];
-//    // 设置代理
-//    documentPickerVC.delegate = self;
-//    // 设置模态弹出方式
-//    documentPickerVC.modalPresentationStyle = UIModalPresentationFormSheet;
-//    [self.navigationController presentViewController:documentPickerVC animated:YES completion:nil];
+    [[downloadManager shareInstance] DownloadFileDoneOneFileFun];
+    
+    NSString *fileName = [self.curDownloadFileModel getFileNameFun];
+    NSString*filePath = [cachesFileManager getFilePathWithName:fileName type:DownLoadFileType];
+    
+    if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]){
+        HLog(@"没有找到文件:%@",fileName);
+        return;
+    }
+    
+    NSURL * fileURL = [NSURL fileURLWithPath:filePath];
+    UIDocumentPickerViewController *documentPickerVC = [[UIDocumentPickerViewController alloc] initWithURL:fileURL inMode:UIDocumentPickerModeExportToService];
+    // 设置代理
+    documentPickerVC.delegate = self;
+    // 设置模态弹出方式
+    documentPickerVC.modalPresentationStyle = UIModalPresentationFormSheet;
+    [ksharedAppDelegate.mainTabBar presentViewController:documentPickerVC animated:YES completion:nil];
+    
+    //[self.navigationController presentViewController:documentPickerVC animated:YES completion:nil];
+    
 }