Found out Swift 5 was released recently, and it looks like less code is needed now, because the code used to retrieve the Documents directory on macOS and iOS now works in Ubuntu, thereby eliminating the need to use conditionals to get the path right.