Swift 3 - Copy Folder w/ contents from Main Bundle to Documents Directory
问题 I have folders with files inside them in my main bundle, and I want to copy/cut them to the Documents Directory at first launch of the application to access them from there. I've seen examples but they're all in Obj-C and I'm using Swift 3. How can I do this? 回答1: I managed to do it using 2 functions: func copyFolders() { let filemgr = FileManager.default filemgr.delegate = self let dirPaths = filemgr.urls(for: .documentDirectory, in: .userDomainMask) let docsURL = dirPaths[0] let folderPath