---
title: "init(url:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/bundle/init(url:)-3n9rf"
---

# init(url:)

Returns an NSBundle object initialized to correspond to the specified file URL.

## Declaration

```swift
convenience init?(url: URL)
```

## Parameters

- `url`: The file URL to a directory. This must be a full URL for a directory; if it contains any symbolic links, they must be resolvable.

## Return Value

Return Value An NSBundle object initialized to correspond to @c url, or @c nil if @c url doesn’t exist or the user doesn’t have access to it.

## Discussion

Discussion This method initializes and returns a new instance only if there is no existing bundle associated with @c url, otherwise it deallocates @c self and returns the existing object.
