PSPDFAnnotationToolbar

The annotation toolbar allows the creation of most annotation types supported by PSPDFKit.

To customize which annotation icons should be displayed, edit editableAnnotationTypes in PSPDFDocument.
Further appearance customization options are documented in the superclass header (PSPDFFlexibleToolbar.h).

PSPDFAnnotationToolbar needs to be used together with a PSPDFFlexibleToolbarContainerView just like its superclass PSPDFFlexibleToolbar.

Note

Directly updating buttons will not work. Use additionalButtons if you want to add custom buttons.

Specifies a list of toolbar configurations amongst which the toolbar can pick when laying out items.
The toolbar automatically picks an appropriate configuration based on the available space.
Items are grouped by default. Set to nil to disable grouping. In that case the toolbar will be populated
by ungrouped items based based on editableAnnotationTypes.

Note

Annotation types that are present in a toolbar configuration but missing in
editableAnnotationTypes will be not be shown.

Access to buttons created based on the state of annotationGroups.
If createFromGroup is set to YES, the toolbar will automatically update and display the queried button,
in case it was previously not the chosen item in the corresponding annotation group.

Declaration

Whether showingStylusButton should be set to YES if an Apple Pencil is detected.
Set this to NO if you don’t want the annotation toolbar to show this button, or want to decide when to show it yourself.
Defaults to YES.

Declaration

Whether stylusButton is shown in the annotation toolbar.
The initial value of this property will be YES if an Apple Pencil has been detected, or NO if not.
This property will be changed by PSPDFKit when detecting an Apple Pencil if showsStylusButtonAutomatically is YES.

It is recommended to only set this to YES only if supporting third-party styli or if your app detects
Apple Pencil touches itself, otherwise the button will be shown even though it isn’t possible to connect a stylus.

Calling the setter of this property does not animate the change. To animate, use setShowingStylusButton:animated:.

Declaration

Shows whether a stylus is being used. This includes Apple Pencil and vendor styli.
Tapping this button shows PSPDFStylusViewController which lets the user change the stylus being used or stop using a stylus.

Declaration

Shows the annotation inspector for the selected annotation type. Hidden (but not removed), if a relevant type
is currently not selected. Only added to the toolbar, if the toolbar contains buttons for supported annotation types.

Note

Not nil by default, but can be override to return nil to remove it from the toolbar.