From the great post here I learned how to read/write files in Swift. I'm having a hard time changing the directory, however.
The line
let dir = FileManager.default.urls( for: .documentDirectory, in: .userDomainMask ).first
points to the user's Documents directory with .documentDirectory. Are there other constants that can be used in place of .documentDirectory that point to common directories such as the Desktop directory? I searched the API reference for .documentDirectory, tried various guesses like ".currentDirectory" (which didn't work), searched stackoverflow, etc. and am coming up empty.
Many thanks in advance!