PTToolGroupToolbar
@interface PTToolGroupToolbar
: UIView <PTAnnotStyleViewControllerDelegate, UIToolbarDelegate>
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, readwrite, nullable) id<PTToolGroupToolbarDelegate> delegate;
Swift
weak var delegate: 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, readwrite, 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, readwrite, 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, readwrite, nullable) NSArray<UIBarButtonItem *> *leadingItems;
Swift
var leadingItems: [UIBarButtonItem]? { get set }
-
The bar button items displayed at the trailing end of the toolbar.
Declaration
Objective-C
@property (nonatomic, copy, readwrite, nullable) NSArray<UIBarButtonItem *> *trailingItems;
Swift
var trailingItems: [UIBarButtonItem]? { get set }
-
The tint color to apply to the
items
.Declaration
Objective-C
@property (nonatomic, strong, readwrite, nullable) UIColor *itemTintColor;
Swift
var itemTintColor: UIColor? { 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 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 orNO
to show it.animated
Specify
YES
if you want to animate the change in visibility orNO
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, readwrite) PTAnnotationStylePresetsView *_Nonnull presetsView;
Swift
var presetsView: PTAnnotationStylePresetsView { get set }
-
Whether the
presetsView
is 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 orNO
to show it.animated
Specify
YES
if you want to animate the change in visibility orNO
if you want the control to appear immediately. -
The annotation style view controller used by to edit annotation style presets.
Declaration
Objective-C
@property (nonatomic, weak, readwrite, nullable) PTAnnotStyleViewController *stylePicker;
Swift
weak var stylePicker: PTAnnotStyleViewController? { get set }
-
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 orNO
to show it.animated
Specify
YES
if you want to animate the change in visibility orNO
if you want the control to appear immediately.