Some test text!
The document viewer classes (
PTTabbedDocumentViewController) come with a lot of built-in functionality, some of which may need to be modified to fit the specific needs of an app.
Because the document viewer classes are part of the open source Tools UI framework, it is possible to achieve virtually any required modification. That said, it is usually faster and more convenient to configure the viewers via APIs, which this guide describes.
To configure a document view controller before it is displayed, conform to and implement the
|Controls the maximum number of concurrent tabs.|
|The current |
|Access to a |
The document view controller has a "hidden" property for each button, so hiding one is a simple matter of setting it to yes:
Buttons can be added by accessing the appropriate BarButtonItem array and adding a button:
Adds a button to the top navigation bar:
The default buttons are all accessible via properties, making it easy to rearrange or move them. The following code swaps the position of the search button and navigation lists button:
The icons of existing buttons may be changed by creating new
UIBarButtonItems that have the same target and action as an existing item, and replacing the existing item with the new item:
PTToolManager is a class that coordinates the UI controls and interaction tools. It provides the ability to customize tool behavior, and enable/disable the ability for users to create or edit annotations (both in general and on an annotation type by annotation type basis).
To disable (or re-enable) the ability to annotate, options can be altered as in the example below. When disabled, the relevant annotation tool is removed from the annotation toolbar, and from the