James Schneider James Schneider - 2 years ago 84
Swift Question

Listing files in a specific folder

I've created a folder called "Photos" in the Documents folder.

Using Swift code, I want to print the names of the files in the Photos folder.

Answer Source
do {
    let files = try NSFileManager.defaultManager().contentsOfDirectoryAtPath("/Users/username/Documents/Photos")
} catch {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download