Make some code more Swifty.
Try an alternative for fileExistsAtPath:isDirectory: