let url = URL(fileURLWithPath: "/Users/username/string with spaces") print(url) // prints "file:///Users/quinn/String%20with%20spaces/"