Hi,
Sorry, a stupid question. I want to rename a file within my dropbox using the swifty dropbox API. But I don't find a rename method and I wanted to check with you the procedure I should be using?
Thanks
Mark
Hi Mark, you can use the move method to rename files or folders.
Thanks Greg,
Here the bear bones code for your readers I put togther; it swaps two files.
let randx = Int(arc4random_uniform(32768)) let sourcePathC = sourcePathB + String(randx) let client = DropboxClientsManager.authorizedClient! _ = client.files.move(fromPath: sourcePathA, toPath: sourcePathC, allowSharedFolder: false, autorename: true) .response { response, error in self.theApp.isNetworkActivityIndicatorVisible = true if let response = response { _ = client.files.move(fromPath: sourcePathB, toPath: sourcePathA, allowSharedFolder: false, autorename: true) .response { response, error in if let response = response { _ = client.files.move(fromPath: sourcePathC, toPath: sourcePathB, allowSharedFolder: false, autorename: true) .response { response, error in if let response = response { self.theApp.isNetworkActivityIndicatorVisible = false } } } } } }