PTAnnotationToolbar

The PTAnnotationToolbar is a toolbar with buttons that allows the user to switch between tools. See the Complete Reader sample project for example usage.

  • Returns a new instance of a PTAnnotationToolbar.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithToolManager:
        (nonnull PTToolManager *)toolManager;

    Swift

    init(toolManager: PTToolManager)
  • A reference to the tool manager, so that that the toolbar can change tools.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTToolManager *_Nonnull toolManager;

    Swift

    var toolManager: PTToolManager { get set }
  • Whether the annotation toolbar should be hidden along with the edit toolbar. The default is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesWithEditToolbar;

    Swift

    var hidesWithEditToolbar: Bool { get set }
  • An object that adopts the PTAnnotationToolbarDelegate protocol.

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<PTAnnotationToolbarDelegate> delegate;

    Swift

    weak var delegate: (any PTAnnotationToolbarDelegate)? { get set }
  • An array of boxed PTAnnotBarButton items that controls the precedence of the toolbar items when there is insufficient space to show them all.

    Example: precedenceArray = @[@(PTAnnotBarButtonClose), @(PTAnnotBarButtonPan), @(PTAnnotBarButtonCloud), @(PTAnnotBarButtonPolygon) ];

    Declaration

    Objective-C

    @property (nonatomic, copy) NSArray<NSNumber *> *_Nonnull precedenceArray;

    Swift

    var precedenceArray: [NSNumber] { get set }
  • Sets the tool on the toolbar. If a tool is activated using another method (e.g. via a long press), this method can be called to make sure the annotation toolbar reflects the active tool.

    Declaration

    Objective-C

    - (void)setButtonForTool:(nullable PTTool *)tool;

    Swift

    func setButtonFor(_ tool: PTTool?)
  • Prepare the toolbar for the given orientation. This will update the toolbar buttons for the available space, showing or hiding buttons as necessary.

    Declaration

    Objective-C

    - (void)rotateToOrientation:(UIDeviceOrientation)orientation;

    Swift

    func rotate(to orientation: UIDeviceOrientation)
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;