Toolbar
-
The annotation toolbar allows the creation of most annotation types supported by PSPDFKit.
To customize which annotation icons should be displayed, edit
editableAnnotationTypes
inPDFConfiguration
. Further appearance customization options are documented in the superclass header (PSPDFFlexibleToolbar.h
).AnnotationToolbar
needs to be used together with aFlexibleToolbarContainer
just like its superclassFlexibleToolbar
.Since the annotation toolbar works with
UIButton
directly (rather than usingUIBarButtonItem
), the buttons in it can’t be added directly to the main toolbar or navigation bar. This must be achieved by adding a custom item to thenavigationItems
ortoolbarItems
that sets the state of theAnnotationStateManager
.The default toolbar position will be
.left
on iPad,.right
on visionOS, and.inTopBar
on all other platforms and configurations.Note
Directly updatingbuttons
will not work. UseadditionalButtons
if you want to add custom buttons.Declaration
Objective-C
@interface PSPDFAnnotationToolbar : PSPDFFlexibleToolbar <PSPDFAnnotationStateManagerDelegate, PSPDFOverridable>
Swift
class AnnotationToolbar : FlexibleToolbar, AnnotationStateManagerDelegate, Overridable
-
Helper for showing/hiding the toolbar on a view controller. Internally manages a
See morePSPDFFlexibleToolbarContainer
.Declaration
Objective-C
@interface PSPDFAnnotationToolbarController : PSPDFFlexibleToolbarController <PSPDFOverridable>
Swift
class AnnotationToolbarController : FlexibleToolbarController, Overridable
-
A custom toolbar, that can be dragged around the screen and anchored to different positions.
This class holds an array of
See moreUIButton
objects. For best results useToolbarButton
or one of its subclasses.FlexibleToolbar
should be used in combination with aFlexibleToolbarContainer
instance. The bar’s visual appearance can be customized using UIAppearance compliant properties.Declaration
Objective-C
@interface PSPDFFlexibleToolbar : PSPDFToolbar
Swift
class FlexibleToolbar : Toolbar
-
The flexible toolbar container holds and manages a
See morePSPDFFlexibleToolbar
instance. Its main responsibilities include toolbar anchoring and drag & drop handling. Add this view to your view hierarchy (a good candidate might be the UINavigationController’s view).Declaration
Objective-C
@interface PSPDFFlexibleToolbarContainer : UIView
Swift
class FlexibleToolbarContainer : UIView
-
Handles the state of the flexible toolbar.
See moreDeclaration
Objective-C
@interface PSPDFFlexibleToolbarController : NSObject <PSPDFFlexibleToolbarContainerDelegate>
Swift
class FlexibleToolbarController : NSObject, FlexibleToolbarContainerDelegate
-
Manages and displays an array of buttons as a toolbar. Similar to UIToolbar, but operates on UIButtons directly and allows for a bit more flexibility during layout. Also provides some more advanced functionality like smart automatic overflow handling.
See moreDeclaration
Objective-C
@interface PSPDFToolbar : UIView
Swift
class Toolbar : UIView
-
A UIButton subclass that mimic the appearance of plain style UIBarButtonItems.
See moreDeclaration
Objective-C
@interface PSPDFToolbarButton : PSPDFButton <PSPDFOverridable>
Swift
class ToolbarButton : PDFButton, Overridable
-
Toolbar drag & drop indicator view.
See moreDeclaration
Objective-C
@interface PSPDFFlexibleToolbarDragView : UIView
Swift
class FlexibleToolbarDragView : UIView