I am trying to write data on the device. But I don't want them to be public to the user and want to save them in a custom reposity. I tried this code
let fileURL = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true).appendingPathComponent("test/mytest")
print(fileURL)
try data?.write(to: fileURL)
this is the obtained path
file:///var/mobile/Containers/Data/Application/34567-234567dfgh-dfghj/Documents/test/mytest
But I get an error telling me that mytest could not be found in folder test