---
title: "init(contentsOfURL:ofType:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsdocument/init(contentsofurl:oftype:)"
---

# init(contentsOfURL:ofType:)

## Declaration

```swift
convenience init(contentsOfURL url: URL, ofType typeName: String) throws
```
