---
title: "Add PDF functionality on iOS | Nutrient iOS SDK"
canonical_url: "https://www.nutrient.io/sdk/ios/getting-started/"
md_url: "https://www.nutrient.io/sdk/ios/getting-started.md"
last_updated: "2026-05-14T16:53:43.984Z"
description: "Learn how to integrate Nutrient iOS SDK into your iOS application. Step-by-step guide for adding PDF viewing, editing, and annotation features."
---

# Add PDF functionality on iOS

This guide explains how to integrate Nutrient iOS SDK into a new or existing iOS project. By the end, you’ll be able to display a PDF document using the default Nutrient user interface (UI).

**Jump to example**

Prefer to jump straight to code? View the example repo on GitHub.

[Read more](https://github.com/PSPDFKit/pspdfkit-ios-catalog.git)

## Requirements

- A Mac running macOS

- The [latest stable version of Xcode](https://developer.apple.com/xcode/)

## Creating your project

Skip this step if you’re using an existing project. If you’re starting a new iOS app, follow the steps below.

**Steps:**

1. Open Xcode and select **File** > **New** > **Project**.

2. Select the **iOS** tab and choose the **App** template.

3. Enter your product name (for example, `Nutrient-Demo`) and organization identifier (for example, `com.example`). You can choose either **SwiftUI** or **Storyboard** (UIKit) as the interface.

4. Click **Next**, choose a location to save the project, and click **Create**.

## Adding Nutrient to your project

**Steps:**

1. In Xcode, select your project.

2. Go to the **Package Dependencies** tab and click **+**.

3. Enter the Nutrient Swift Package URL into the search field:

   ```

   https://github.com/PSPDFKit/PSPDFKit-SP
   ```

4. In the **Dependency Rule** fields, select:
   - **Branch** > `master` — to use the latest version
   - **Version** > **Up to Next Minor** — for controlled updates

5. Click **Add Package**. Confirm the addition.

   > In this confirmation step, ensure that the **Add to Target** column displays the correct target (usually the app target), and that the checkbox on the left is selected. For many projects — especially newly created ones — there will only be one target, so you can click the **Add Package** button again. However, for more complex projects with multiple targets, it’s important to double-check this setting.

Nutrient will now appear under **Swift Package Dependencies**.

## Displaying a PDF

### SwiftUI

**Steps:**

1. Add your PDF file to the project by dragging it into the Xcode project navigator. Click **Finish** when prompted.

2. In the file for your view (`ContentView.swift` for a new project), import the Nutrient iOS SDK:

   ```swift

   import PSPDFKit
   import PSPDFKitUI
   ```

3. Display the PDF using the following code:

   ```swift

   struct ContentView: View {
       // Update to use your document name.
       let document = Document(url: Bundle.main.url(forResource: "Document", withExtension: "pdf")!)
       @PDFView.Scope private var scope

       var body: some View {
           NavigationStack {
               PDFView(document: document).toolbar {
                       // Add Nutrient viewer's default toolbar items to include buttons for searching, annotating, and more.
                       DefaultToolbarButtons()
                   }
                   // Set the scope for the view hierarchy so the default toolbar buttons and the `PDFView` can communicate..pdfViewScope(scope)
           }
       }
   }
   ```

4. Build and run your application.

### UIKit

**Steps:**

1. Add your PDF file to the project by dragging it into the Xcode project navigator. Click **Finish** when prompted.

2. In your `UIViewController` subclass, import the Nutrient iOS SDK:

   ```swift

   import PSPDFKit
   import PSPDFKitUI
   ```

3. Display the PDF using the following code. You can place this inside [`viewDidAppear(_:)`](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621423-viewdidappear), a button action handler, a table view cell selection delegate, or any other suitable place:

   ```swift

     // Update to use your document name.
    let fileURL = Bundle.main.url(forResource: "Document", withExtension: "pdf")!
    let document = Document(url: fileURL)

    // The configuration closure is optional and allows additional customization.
    let pdfController = PDFViewController(document: document) {
      $0.isPageLabelEnabled = false
    }

    // Present the PDF view controller within a `UINavigationController` to show built-in toolbar buttons.
    present(UINavigationController(rootViewController: pdfController), animated: true)
   ```

4. Build and run your application.

You’ll now see your PDF document displayed using Nutrient iOS SDK’s built-in viewer.

## Next steps

- [Add your license key](https://www.nutrient.io/guides/ios/getting-started/adding-the-license-key.md) to disable watermarks. Nutrient is commercial software.

- [Add AI capabilities to Nutrient’s document viewer](https://www.nutrient.io/guides/ios/ai-assistant.md).

- [Customize the UI and other SDK functionality](https://www.nutrient.io/guides/ios/getting-started/view-controller-configuration.md).

- [Add document collaboration through Instant](https://www.nutrient.io/guides/ios/pspdfkit-instant/getting-started.md).

- [Add OCR support to recognize text in scanned documents](https://www.nutrient.io/guides/ios/ocr/getting-started.md).

For getting started on Mac Catalyst or visionOS, first follow the same instructions above, and then refer to the [Mac Catalyst and visionOS](https://www.nutrient.io/sdk/ios/getting-started/mac-catalyst-or-visionos.md) guide for specific instructions.

The getting started steps mentioned in this guide are for Swift Package Manager, which is our recommendation. Alternatively, you can add Nutrient to your project [manually](https://www.nutrient.io/sdk/ios/getting-started/ios-manual-integration.md) or using [CocoaPods](https://www.nutrient.io/sdk/ios/getting-started/ios-cocoapods.md).
---

## Related pages

- [Add PDF functionality on iOS](/sdk/ios/getting-started/ios-cocoapods.md)
- [Add PDF functionality on Mac Catalyst or visionOS](/sdk/ios/getting-started/mac-catalyst-or-visionos.md)
- [Add PDF functionality on iOS](/sdk/ios/getting-started/ios-manual-integration.md)

