Skip to content

Instance Method

deletingLastPathComponent()

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
Returns a URL constructed by removing the last path component of self.
func deletingLastPathComponent() -> URL

Discussion

This function may either remove a path component or append /... If the URL has an empty path that is not resolved against a base URL (e.g., http://www.example.com), then this function will return the URL unchanged.