> 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/tools-protocols.md).

# Tools protocols

Learn about the tools hierarchy in Apryse versions 6.8+. Understand Protocols, ToolSwitching, Events, and more. Enhance your PDF user interactive behavior efficiently. The Apryse iOS SDK streamlines s

This document explains the tools hierarchy in Apryse versions 6.8 and greater.

## Tools Protocols

![](https://4149080208-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgY6xtY9ZQd9XMpvWlGM0%2Fuploads%2Fgit-blob-f043561a403222880b8e97f7a12a89f23d23a475%2F24a39e161354783eeaebc89fc1e9f6f49ed3bf96-960x540.png?alt=media)

\##Protocols

### [`PTPDFViewCtrlToolDelegate`](https://sdk.apryse.com/api/ios/Protocols/PTPDFViewCtrlToolDelegate.html)

Events that occur on the `PTPDFViewCtrl`, such as touches began, moved, ended; tapped, long press; scrolled, etc. These are used to implement user interactive behaviour on the PDF.

### [`PTToolSwitching`](https://sdk.apryse.com/api/ios/Protocols/PTToolSwitching.html)

Adds properties and methods to `PTPDFViewCtrlToolDelegate` for initializing a tool, switching to a new tool, and accessing the tool’s state. The events declared by `PTPDFViewCtrlToolDelegate` are general, whereas those declared by `PTToolSwitching` are used by the stock implementation of the tools, and the tool manager.

### [`PTToolEvents`](https://sdk.apryse.com/api/ios/Protocols/PTToolEvents.html)

Declares an interface that individual tools (`PTPanTool`, `PTAnnotEditTool`, etc.) use to report on events that they cause, such as annotation added/modified, etc. It also adds methods that individual tools use for querying desired behaviour, such as if a link should be followed or not.

The tools could have held a ToolManager instance, but this protocol distils what is actually required of it from a tool’s perspective. The events aren’t dealt with by the toolmanager directly, but are passed to the tool manager’s delegate.

### [`PTToolManagerDelegate`](https://sdk.apryse.com/api/ios/Protocols/PTToolManagerDelegate.html)

Allows the app to be notified of events that occur due to actions of the tools framework (such as annotation added/modified, etc.), as well as modify default Tools.framework behaviour, for example if a link should be followed or not when tapped.

\##Classes

### [`PTPDFViewCtrl`](https://sdk.apryse.com/api/ios/Classes/PTPDFViewCtrl.html)

The control that displays a PDF.

### [`PTToolManager`](https://sdk.apryse.com/api/ios/Classes/PTToolManager.html)

A class that mediates between the `PTPDFViewCtrl` and the individual tools (`PTPanTool`, `PTAnnotEditTool`, etc.), and between the individual tools and an app’s ViewController. It passes events from the `PTPDFViewCtrl` to the active tool, facilitates switching from one tool to the next.

### [`PTTool`](https://sdk.apryse.com/api/ios/Classes/PTTool.html)

An abstract base class that implements the `Tools.framework` default and shared functionality for the `PTToolSwitching` protocol.

## Relationships

These relationships are referring to those labled in the diagram at the top of the article.

### A.

An instance of a `PTToolManager` is set as the `PTPDFViewCtrl`’s `toolDelegate` so that it can pass on the event to the currently active tool (`PTPanTool`, `PTAnnotEditTool`, etc.).

### B.

The `PTToolManager`’s `tool` property is the tool instance that is currently active. It is the tool to which all events are sent.

### C.

A tool has a reference back to the `PTToolManager` instance so that it can report changes it has made to the document (such as annotation added/modified, etc.), and to check if default behaviour should be followed (such as following a link, etc). These events aren’t used by the `PTToolManager` itself, but are passed to the object set as the `PTToolManager`’s delegate.

### D.

The `PTToolManager`’s delegate property receives the events passed to the `PTToolManager` by the collection of tools (such as annotation added/modified, etc.).


---

# 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/tools-protocols.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.
