I have a swift file on my server that I access using an absolute path. Eventually, the path will change when I'll host the server somewhere.
The current path:
"/Users/user/projects/ios-projects/project-name/resources/myfolder/myfile"
What I want to achieve:
"../../../resources/myfolder/myfile"
I've looked into relative paths in swift, but everything looks outdated and suggests using 3rd party libraries.
Also some suggested using FileManager.default.currentDirectoryPath but it is giving me a different path.
FileManager.default.currentDirectoryPath
"/Users/user/Library/Developer/Xcode/DerivedData/projectname-ebbjtdinidfrryclqgpbyitmljjo/Build/Products/Debug"
Is there a way to get the desired relative path using FileManager?