How to create a directory in downloads folder with swift on macos? Permission exception.
问题 I am struggling to simply create a folder in the users download directory on macos with this code: static func createFolderInDownloadsDirectory() { let downloadsDirectory = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first! let downloadsDirectoryWithFolder = downloadsDirectory.appendingPathComponent("FolderToCreate") do { try FileManager.default.createDirectory(at: downloadsDirectoryWithFolder, withIntermediateDirectories: true, attributes: nil) } catch let error