When i am copy files from document directory to application bundle directory it gives error like this :
“Images” couldn’t be copied because you don’t have permission to access “Resources”.
My code
let fileManager = FileManager.default
let documentDirectoryPath = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first?.appendingPathComponent("Images")
let bundleDirectoryPath = (Bundle.main.resourceURL?.appendingPathComponent("GCDWebUploader.bundle").appendingPathComponent("Contents").appendingPathComponent("Resources").appendingPathComponent("Images"))
do {
try fileManager.copyItem(at: documentDirectoryPath!, to: bundleDirectoryPath!)
} catch let error as NSError {
print("Couldn't copy file to final location! Error:\(error.description)")
}