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

# init(url:)

Returns an NSBundle object that corresponds to the specified file URL.

## Declaration

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

## Parameters

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

## Return Value

Return Value The NSBundle object that corresponds to url, or nil if url does not identify an accessible bundle directory.

## Discussion

Discussion This method allocates and initializes the returned object if there is no existing NSBundle associated with url, in which case it returns the existing object.

## See Also

### Creating and initializing a bundle

- [init(for:)](foundation/bundle/init(for:).md)
- [init(identifier:)](foundation/bundle/init(identifier:).md)
- [init(path:)](foundation/bundle/init(path:).md)
