Skip to content

Initializer

init(fileURLWithPath:)

iOS 8.0+Deprecated iPadOS 8.0+Deprecated Mac Catalyst 8.0+Deprecated macOS 10.10+Deprecated tvOS 9.0+Deprecated visionOS 1.0+Deprecated watchOS 2.0+Deprecated

Deprecated

Use init(filePath:directoryHint:relativeTo:) instead

Creates a file URL that references the local file or directory at the given path.
init(fileURLWithPath path: String)

Parameters

path

The location in the file system.

Discussion

If an empty string is used for the path, the system interprets it as “.”.