Documents Directory
Problem Descriptionβ
Write a function that returns a URL to the userβs documents directory. The function should return an optional URL that points to the user's Documents directory.
Inputβ
- No input.
Outputβ
- An optional URL pointing to the user's Documents directory.
Constraintsβ
- The function should handle cases where the Documents directory is not accessible or does not exist.
Exampleβ
Input:
(No input)Output:
URL pointing to the user's Documents directoryExplanation:
The function retrieves the path to the user's Documents directory and returns it as a URL. If the directory cannot be found, the function returnsnil
.