FileManager.urls(for:in:)
is only intended for specific common directories, such as the applications folder and desktop folder. If you want to retrieve the top-level contents of a directory, use FileManager.contentsOfDirectory(at:includingPropertiesForKeys:options:)
. Otherwise, use enumerator(at:includingPropertiesForKeys:options:errorHandler:)
to recursively enumerate a directory.
Also, please learn how to use markdown.