Skip to content

Instantly share code, notes, and snippets.

@srstanic
Created January 29, 2021 12:15
Show Gist options
  • Save srstanic/8fba445d3d7c8c54af02153b33cb777f to your computer and use it in GitHub Desktop.
Save srstanic/8fba445d3d7c8c54af02153b33cb777f to your computer and use it in GitHub Desktop.
extension FileManager {
func isDirectory(at url: URL) -> Bool {
var isDirectory: ObjCBool = false
guard FileManager.default.fileExists(atPath: url.path, isDirectory: &isDirectory) else {
return false
}
return isDirectory.boolValue
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment