TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Oct 2017 |
SwiftSwift Version | 3.x |
SPMSupports SPM | ✗ |
Maintained by asashin227.
LocalFileManager is Wrapped FileManager so that it can be used easily.
let fileManager = LocalFileManager()
let dirPath = try! fileManager.absolutePath(.libraryDirectory)
let files = try! fileManager.files(at: directoryPath)!
files.forEach() {
file in
let fileName = file.name
let path = file.path!
let data = file.data!
}
let fileManager = LocalFileManager()
// Load file.
let filePath = try! fileManager.absolutePath(.libraryDirectory, path: "/hoge/fuga/img.png")
let file = try! File(path: filePath)
// Delete file.
try! fileManager.delete(file)
// Save file.
try! fileManager.save(file)
// Copy file.
let copyPath = try! fileManager.absolutePath(.libraryDirectory, path: "/hoge/fuga/img.png")
let copiedFile = try! fileManager.copy(file, to: copyPath)
LocalFileManager is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod "LocalFileManager"
LocalFileManager is available under the MIT license.