PTToolGroupToolbar


@interface PTToolGroupToolbar
    : UIView <PTAnnotStyleViewControllerDelegate, UIToolbarDelegate,
              PTAnnotationStylePresetsViewDelegate, PTOverridable>

The PTToolGroupToolbar displays a list of buttons that allow the user to switch between tools in a PTToolManager instance. The set of tool buttons displayed by this control can be selected from a list of “Annotation Modes”, each of which have different tools available for different tasks (drawing, measuring, etc.). The tool groups are controlled by a PTToolGroupManager instance used by the toolbar.

The tool buttons in the toolbar are represented by UIBarButtonItem instances. The list of buttons for the current tool group are displayed in a scrollable area of the toolbar.

In addition to the tool buttons displayed in the center of the toolbar, other buttons can be shown pinned at the leading and trailing ends of the toolbar. By default the PTToolGroupManager.undoButtonItem and PTToolGroupManager.redoButtonItem buttons are shown at the trailing end of the toolbar.

  • Initializes a newly created PTToolGroupToolbar instance with the provided tool group manager.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithToolGroupManager:
        (nonnull PTToolGroupManager *)toolGroupManager;

    Swift

    init(toolGroupManager: PTToolGroupManager)

    Parameters

    toolGroupManager

    The tool group manager to be used by the receiver

    Return Value

    an initialized PTToolGroupToolbar instance

  • The delegate object of the tool group toolbar.

    Declaration

    Objective-C

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

    Swift

    weak var delegate: (any PTToolGroupToolbarDelegate)? { get set }
  • The tool group manager instance used to control the current tool group and the set of bar button items displayed in this tool group toolbar.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) PTToolGroupManager *toolGroupManager;

    Swift

    var toolGroupManager: PTToolGroupManager? { get set }
  • The bar button items displayed in the scrollable area of the toolbar.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *items;

    Swift

    var items: [UIBarButtonItem]? { get set }
  • The bar button items displayed at the leading end of the toolbar.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *leadingItems;

    Swift

    var leadingItems: [UIBarButtonItem]? { get set }
  • The bar button items displayed at the trailing end of the toolbar.

    The default value of this property contains the PTToolGroupManager.undoButtonItem and PTToolGroupManager.redoButtonItem items.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *trailingItems;

    Swift

    var trailingItems: [UIBarButtonItem]? { get set }
  • Whether the list of items in trailingItems is updated automatically.

    When the list of trailing items includes the PTToolGroupManager.undoButtonItem and/or PTToolGroupManager.redoButtonItem items, these items will be added or removed from the list based on whether undo/redo is currently available.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallyUpdatesTrailingItems;

    Swift

    var automaticallyUpdatesTrailingItems: Bool { get set }
  • The tint color to apply to the items.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *itemTintColor;

    Swift

    var itemTintColor: UIColor? { get set }
  • Whether the shadow shown by the toolbar is hidden.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isShadowHidden) BOOL shadowHidden;

    Swift

    var isShadowHidden: Bool { get set }
  • The alignment of the items within the scrollable area of the toolbar.

    The default value of this property is PTToolGroupToolbarAlignmentLeading.

    Declaration

    Objective-C

    @property (nonatomic) PTToolGroupToolbarAlignment itemsAlignment;

    Swift

    var itemsAlignment: PTToolGroupToolbarAlignment { get set }
  • The title of the button shown to complete the annotation for multi-action annotation creation tools (polyline, polygon, etc.)

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull completeAnnotationButtonTitle;

    Swift

    var completeAnnotationButtonTitle: String { get set }
  • Whether annotation style presets are enabled and will be shown when necessary.

    This property controls the presetsToolbarEnabled and presetsViewEnabled properties, but it does not have its own state. The property’s getter returns true if either of the aforementioned properties are enabled.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=arePresetsEnabled) BOOL presetsEnabled;

    Swift

    var arePresetsEnabled: Bool { get set }
  • The annotation style presets toolbar displayed when a tool is active in a horizontally compact environment.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) PTAnnotStyleToolbar *_Nonnull presetsToolbar;

    Swift

    var presetsToolbar: PTAnnotStyleToolbar { get }
  • Whether the presetsToolbar is enabled and will be shown when necessary.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPresetsToolbarEnabled) BOOL presetsToolbarEnabled;

    Swift

    var isPresetsToolbarEnabled: Bool { get set }
  • Whether the presetsToolbar is currently hidden.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPresetsToolbarHidden) BOOL presetsToolbarHidden;

    Swift

    var isPresetsToolbarHidden: Bool { get set }
  • Sets whether the presetsToolbar is hidden.

    Declaration

    Objective-C

    - (void)setPresetsToolbarHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setPresetsToolbarHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the presets toolbar or NO to show it.

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the control to appear immediately.

  • The annotation style presets view displayed when a tool is active in a horizontally regular environment.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTAnnotationStylePresetsView *_Nonnull presetsView;

    Swift

    var presetsView: PTAnnotationStylePresetsView { get set }
  • Whether the presetsView is enabled and will be shown when necessary.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPresetsViewEnabled) BOOL presetsViewEnabled;

    Swift

    var isPresetsViewEnabled: Bool { get set }
  • Whether the presetsView is currently hidden.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPresetsViewHidden) BOOL presetsViewHidden;

    Swift

    var isPresetsViewHidden: Bool { get set }
  • Sets whether the presetsView is hidden.

    Declaration

    Objective-C

    - (void)setPresetsViewHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setPresetsViewHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the presets view or NO to show it.

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the control to appear immediately.

  • Whether the edit view shown for multi-action annotation creation tools (polyline, polygon, etc.) is hidden.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isEditViewHidden) BOOL editViewHidden;

    Swift

    var isEditViewHidden: Bool { get set }
  • Sets whether the edit view is hidden.

    Declaration

    Objective-C

    - (void)setEditViewHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setEditViewHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the edit view or NO to show it.

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the control to appear immediately.