Contents

NSHomeDirectory()

Returns the path to either the user’s or application’s home directory, depending on the platform.

Declaration

func NSHomeDirectory() -> String

Return Value

The path to the current home directory.

Discussion

In iOS, the home directory is the application’s sandbox directory. In macOS, it’s the application’s sandbox directory, or the current user’s home directory if the application isn’t in a sandbox.

See Also

Accessing user directories