> 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/ui-customization/navigation-lists.md).

# List container to customize horizontal menu layout on iOS

Learn how to use the PTNavigationListsViewController class to manage annotation lists, document outlines, and user-defined bookmarks with a UITabBarController-like interface. Customize your navigation

The [`PTNavigationListsViewController`](https://sdk.apryse.com/api/ios/Classes/PTNavigationListsViewController.html) class is a container view controller that shows the [annotation list](/ios/annotation/annotation-list-i.md), [document outline](/ios/bookmarks/outline.md), and [user-defined bookmark](/ios/bookmarks/user-bookmarks-i.md) list controls with a `UITabBarController`-like interface. A segmented control is used to select which child view controller to display.

![](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 navigation lists 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 a navigation lists view controller

To create a new navigation lists view controller and display it from another view controller, set the child list view controllers to the `PTNavigationListsViewController` class's [`listViewControllers`](https://sdk.apryse.com/api/ios/Classes/PTNavigationListsViewController.html#/c:objc\(cs\)PTNavigationListsViewController\(py\)listViewControllers) property:

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

```swift
// Initialize a new navigation lists view controller.
let navigationListsViewController = PTNavigationListsViewController(toolManager: toolManager)

// Initialize an annotation, outline, and bookmark view controller with a PTPDFViewCtrl instance.
let annotationViewController = PTAnnotationViewController(pdfViewCtrl: pdfViewCtrl)
annotationViewController.delegate = self

let outlineViewController = PTOutlineViewController(pdfViewCtrl: pdfViewCtrl)
outlineViewController.delegate = self

let bookmarkViewController = PTBookmarkViewController(pdfViewCtrl: pdfViewCtrl)
bookmarkViewController.delegate = self

// Set the array of child view controllers to display.
navigationListsViewController.listViewControllers = [outlineViewController, annotationViewController, bookmarkViewController]

if ( UIDevice.current.userInterfaceIdiom == .pad ) {
    navigationListsViewController.modalPresentationStyle = .popover
    navigationListsViewController.popoverPresentationController?.barButtonItem = navigationListsButton
} else {
    navigationListsViewController.modalPresentationStyle = .fullScreen
}

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

{% endcode %}
{% endtab %}

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

```objc
// Initialize a new navigation lists view controller.
PTNavigationListsViewController* navigationListsViewController = [[PTNavigationListsViewController alloc] initWithToolManager:self.toolManager];

// Initialize an annotation, outline, and bookmark view controller with a PTPDFViewCtrl instance.
PTAnnotationViewController* annotationViewController = [[PTAnnotationViewController alloc] initWithPDFViewCtrl:self.pdfViewCtrl];
annotationViewController.delegate = self;

PTOutlineViewController *outlineViewController = [[PTOutlineViewController alloc] initWithPDFViewCtrl:self.pdfViewCtrl];
outlineViewController.delegate = self;

PTBookmarkViewController *bookmarkViewController = [[PTBookmarkViewController alloc] initWithPDFViewCtrl:self.pdfViewCtrl];
bookmarkViewController.delegate = self;

// Set the array of child view controllers to display.
navigationListsViewController.listViewControllers = @[outlineViewController, annotationViewController, bookmarkViewController];

if (self.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        selfnavigationListsViewController.modalPresentationStyle = UIModalPresentationPopover;
        UIPopoverPresentationController *popoverController = navigationListsViewController.popoverPresentationController;
        popoverController.barButtonItem = self.navigationListsButton;
} else {
        navigationListsViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}
[self presentViewController:navigationListsViewController animated:YES completion:nil];
```

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

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

The navigation list view controller is designed to be presented in a popover on iPads. To do so, you must provide the `PTNavigationListsViewController`'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 %}

## Customization

The `PTNavigationListViewController` provides a flexible API for displaying only the desired child view controllers. Any of the annotation list, document outline, or user-defined bookmark list view controllers can be removed by omitting them from the `listViewControllers` property. It is also possible to add a custom child view controller by adding it to the `listViewControllers` array.

To specify which of the child view controllers to display on opening the navigation list control, either the [`selectedIndex`](https://sdk.apryse.com/api/ios/Classes/PTNavigationListsViewController.html#/c:objc\(cs\)PTNavigationListsViewController\(py\)selectedIndex) , or the [`selectedViewController`](https://sdk.apryse.com/api/ios/Classes/PTNavigationListsViewController.html#/c:objc\(cs\)PTNavigationListsViewController\(py\)selectedViewController) property can be used.

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

```swift
// Add a custom view controller to an existing navigation list control
let customViewController = UIViewController()
navigationListsViewController.listViewControllers?.append(customViewController)

// Show the navigationListsViewController's annotationViewController on opening
navigationListsViewController.selectedViewController = navigationListsViewController.annotationViewController
// OR specify an index to show from the `listViewControllers` property
navigationListsViewController.selectedIndex = 0
```

{% endcode %}
{% endtab %}

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

```objc
// Add a custom view controller to an existing navigation list control
UIViewController *customViewController = [[UIViewController alloc] init];
navigationListsViewController.listViewControllers = [navigationListsViewController.listViewControllers arrayByAddingObject:customViewController];

// Show the navigationListsViewController's annotationViewController on opening
navigationListsViewController.selectedViewController = navigationListsViewController.annotationViewController;
// OR specify an index to show from the `listViewControllers` property
navigationListsViewController.selectedIndex = 0;
```

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


---

# 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/ui-customization/navigation-lists.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.
