Created
January 29, 2021 12:15
-
-
Save srstanic/8fba445d3d7c8c54af02153b33cb777f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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