FileKit is the easy way to handle all your files and directories on the disk. Build on top of the NSFileManager and with pure swift, it's all you need to build great apps.
At first you have to import the framework into your project. All you need to do is to write a simple import statement.
import FileKit
var file = File("~/Desktop/test.txt")
file.create()
file.content = "Just a test!"
var directory = Directory("~/Documents/cat.png")
var root = Directory.root
var home = Directory.home?
var applications = Directory.applications?
var music = Directory.music?
var movies = Directory.movies?
// And many more...
var pathToRoot = Path("/")
var directory = Directory(path: pathToRoot)
var pathToImage = Path.home.child("pictures/funny-cat.png")
var file = File(path: pathToImage)
var file = File("~/Pictures/hilarious-duck.png")
if var directory = Directory.desktop? {
directory.add(file)
}
if var items = Directory.home?.content {
for item in items {
println(item.name)
}
}
- Write Unit Tests
FileKit is a private project and it's not allowed to share any code without the permission of the project owner.
- Alexander Barton ([email protected])