Skip to main content

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 directory

Explanation:
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 returns nil.