I am trying to get the size of a directory, as well as it\'s content on OS X using Swift. So far, I have only been able to get the size of the directory itself, with none of
Swift 3 version
private func sizeToPrettyString(size: UInt64) -> String {
let byteCountFormatter = ByteCountFormatter()
byteCountFormatter.allowedUnits = .useMB
byteCountFormatter.countStyle = .file
let folderSizeToDisplay = byteCountFormatter.string(fromByteCount: Int64(size))
return folderSizeToDisplay
}