Check if path is a directory in Swift2? : <p>If like to attain functionality similar to that of Bash's <code>-d</code> <code>if</code> condition.</p>

<p>I am aware of how to test if a file exists with <code>fileExistsAtPath()</code>, which returns a bool "true" if the file exists and "false" if it doesn't (assuming <code>path</code> is a string containing the path to the file):</p>

<pre><code>if NSFileManager.fileExistsAtPath(path) {
    print("File exists")
} else {
    print("File does not exist")
}
</code></pre>

<p>However, I would like to check if the path specified in <code>path</code> is a directory, similar to the following <code>bash</code> code:</p>

<pre><code>if [ -d "$path" ]; then
    echo "$path is a directory"
elif [ -f "$path" ]; then
    # this is effectively the same as fileExistsAtPath()
    echo "$path is a file"
fi
</code></pre>

<p>Is this possible, and if yes, how should it be performed?</p>
