> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/ios/annotation/annotation-list-i.md).

# View annotations as list on iOS

Discover how to use the PTAnnotationViewController class to manage annotations in your PDF documents with ease. Learn how to display, create, and interact with annotations effectively. Explore the fun

The [`PTAnnotationViewController`](https://sdk.apryse.com/api/ios/Classes/PTAnnotationViewController.html) class shows a list of all annotations in a document being viewed by a [`PTPDFViewCtrl`](https://sdk.apryse.com/api/ios/Classes/PTPDFViewCtrl.html). The list contains any comments that have been added to the annotations.

![](https://4149080208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgY6xtY9ZQd9XMpvWlGM0%2Fuploads%2Fgit-blob-3b4fe3f15304cc68df980f8cdd4bc58c4130a6d3%2F08935ed43ed617260c9ad07c1e040c5114e3ba47-1242x2208.png?alt=media)

*The annotations list control is part of the Tools library, so make sure you have* [*added the Tools library to your project*](/ios/ui-customization/setup.md)*.*

## Show an annotation view controller

To create a new annotation view controller instance and display it from another view controller, supply a `PTPDFViewCtrl` instance to the `PTAnnotationViewController` designated initializer:

{% tabs %}
{% tab title="Swift" %}
{% code lineNumbers="true" %}

```swift
// Initialize annotation view controller with a PTPDFViewCtrl instance.
let annotationViewController = PTAnnotationViewController(pdfViewCtrl: pdfViewCtrl)

// Set the current view controller as the annotation view controller's delegate.
annotationViewController.delegate = self

let navigationController = UINavigationController(rootViewController: annotationViewController)
if ( UIDevice.current.userInterfaceIdiom == .pad ) {
    navigationController.modalPresentationStyle = .popover
    navigationController.popoverPresentationController?.barButtonItem = annotationListButton
}

self.present(navigationController, animated: true, completion: nil)
```

{% endcode %}
{% endtab %}

{% tab title="Obj-C" %}
{% code lineNumbers="true" %}

```objc
// Initialize annotation view controller with a PTPDFViewCtrl instance.
PTAnnotationViewController *annotationViewController = [[PTAnnotationViewController alloc] initWithPDFViewCtrl:pdfViewCtrl];

// Set the current view controller as the annotation view controller's delegate.
annotationViewController.delegate = self;

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:annotationViewController];
if ( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ) {
    navigationController.modalPresentationStyle = UIModalPresentationPopover;
    navigationController.popoverPresentationController.barButtonItem = self.annotationListButton;
}

[self presentViewController:navigationController animated:YES completion:nil];
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**The annotation view controller must be pushed onto a navigation controller's stack before being shown.**
{% endhint %}

{% hint style="info" %}
**Presenting on iPads:**

The annotation view controller is designed to be presented in a popover on iPads. To do so, you must provide the `PTAnnotationViewController`'s [`UIPopoverPresentationController`](https://developer.apple.com/uikit/uipopoverpresentationcontroller/) with either:

* a [`sourceRect`](https://developer.apple.com/uikit/uipopoverpresentationcontroller/1622324-sourcerect/) AND
* a [`sourceView`](https://developer.apple.com/uikit/uipopoverpresentationcontroller/1622313-sourceview/)

OR

* a [`barButtonItem`](https://developer.apple.com/uikit/uipopoverpresentationcontroller/1622314-barbuttonitem/)

as in the example above.
{% endhint %}

You can set a delegate to be notified by the annotation view controller when annotations are selected with the `PTAnnotationViewControllerDelegate` protocol. (See the CompleteReader sample for usage of the `PTAnnotationViewController`.)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/ios/annotation/annotation-list-i.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
