There is common pattern for iOS Documents directory retrieval:
let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
let documentsDirectory = paths[0]
However, if paths
array is empty above code will crash with 'Index out of bounds' error.
Is it safe to assume that Documents directory is always available and that paths
will always contain at least one entry in above code?
I want to avoid paranoid programming and code sprinkled with unnecessary testing for Documents directory existence.