0
フォルダをドキュメントディレクトリにコピーしましたが、ディレクトリのコンテンツを列挙できますが、列挙されたURLが存在し、読み取り可能かどうかを確認すると、falseになります。これらのファイルをどのように読み、使用しますか?iOSアプリのドキュメントディレクトリにあるファイルを読み込んで開きますか?
let imagesURL = copyPath.appendingPathComponent("images", isDirectory: true)
guard let fileEnumerator = FileManager.default.enumerator(at: imagesURL, includingPropertiesForKeys: nil, options: FileManager.DirectoryEnumerationOptions()) else { return }
while let file = fileEnumerator.nextObject() {
guard let filepath = file as? NSURL else { continue }
print(filepath.absoluteString!)
let isReadable = FileManager.default.isReadableFile(atPath: filepath.absoluteString!)
let exists = FileManager.default.fileExists(atPath: filepath.absoluteString!)
print("isReadable: \(isReadable), exists: \(exists)")
}