---
title: "init(fromPasteboard:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsurl/init(frompasteboard:)"
---

# init(fromPasteboard:)

Reads an NSURL object off of the specified pasteboard.

## Declaration

```swift
init?(fromPasteboard pasteBoard: NSPasteboard)
```

```swift
init?(from pasteBoard: NSPasteboard)
```

## Parameters

- `pasteBoard`: The target pasteboard.

## Return Value

Return Value A NSURL object, or nil if the pasteboard does not contain NSURLPboardType data.

## See Also

### Working with Pasteboards

- [write(to:)](foundation/nsurl/write(to:).md)
