A FileManager Swift extension to manage iOS file systems basics with ease

I recently spent some time figuring out the best way to find the URL/paths of the recommended iOS file system used directories.

I felt that iOS URL/paths was very confusing:

So I came up with this little FileManager’s extension that could be useful to many:

extension FileManager {
    func homeDirectory() -> URL {
        return URL(fileURLWithPath: NSHomeDirectory())
    }

    func homeDirectoryPath() -> String {
        return NSHomeDirectory()
    }

    func tmpDirectory() -> URL {
        return homeDirectory().appendingPathComponent("tmp")
    }

    // ...
}