Browse Source

add moveFile

marinofaggiana 4 years ago
parent
commit
ec38f7d394
2 changed files with 12 additions and 1 deletions
  1. 1 1
      Nextcloud.xcodeproj/project.pbxproj
  2. 11 0
      iOSClient/Utility/NCUtilityFileSystem.swift

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -2807,7 +2807,7 @@
 			repositoryURL = "https://github.com/nextcloud/ios-communication-library/";
 			requirement = {
 				kind = revision;
-				revision = b8f648a456ace227573f2d77677fdf034f96b562;
+				revision = df8e88e8199bad3cbfb88362219da6633f25d62e;
 			};
 		};
 		F7C4D88B2534887E00C142DA /* XCRemoteSwiftPackageReference "Parchment" */ = {

+ 11 - 0
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -97,6 +97,17 @@ class NCUtilityFileSystem: NSObject {
         catch {}
     }
     
+    @objc func moveFile(atPath: String, toPath: String) {
+
+        do {
+            try FileManager.default.removeItem(atPath: toPath)
+            try FileManager.default.copyItem(atPath: atPath, toPath: toPath)
+            try FileManager.default.removeItem(atPath: atPath)
+        }
+        catch {}
+        
+    }
+    
     @objc func moveFileInBackground(atPath: String, toPath: String) {
         
         DispatchQueue.global().async {