Created
November 13, 2014 04:01
-
-
Save s3itz/8d4a458e1c7cc63a0cec 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 NSFileManager { | |
func fileExists(path: String) -> (Bool, isDirectory: Bool) { | |
var dir: ObjCBool = true | |
let status = self.fileExistsAtPath(path, isDirectory: &dir) | |
return (status, dir.boolValue) | |
} | |
} | |
NSFileManager.defaultManager().fileExists("/Applications").isDirectory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment