PSPDFAnnotationGroup

Objective-C


@interface PSPDFAnnotationGroup : PSPDFModel

Used to configure custom annotation groups for the annotation toolbar.

[[PSPDFAnnotationToolbarConfiguration alloc] initWithAnnotationGroups:@[
    [PSPDFAnnotationGroup groupWithItems:@[
        [PSPDFAnnotationGroupItem itemWithType:PSPDFAnnotationStringInk variant:PSPDFAnnotationVariantStringInkPen configurationBlock:[PSPDFAnnotationGroupItem inkConfigurationBlock]]
    ]],
    [PSPDFAnnotationGroup groupWithItems:@[
        [PSPDFAnnotationGroupItem itemWithType:PSPDFAnnotationStringLine],
        [PSPDFAnnotationGroupItem itemWithType:PSPDFAnnotationStringPolyLine]
    ]],
]];
  • Creates a new annotation group with the provided items and designates the first item as the current choice.

    See

    groupWithItems:choice:

    Declaration

    Objective-C

    + (nonnull PSPDFAnnotationGroup *)groupWithItems:
        (nonnull NSArray<PSPDFAnnotationGroupItem *> *)items;
  • Creates a new annotation group with the provided items and designates the item at index choice as the current selection.

    Note

    Items will deep copied (don’t rely on referential equality).

    Declaration

    Objective-C

    + (nonnull PSPDFAnnotationGroup *)
        groupWithItems:(nonnull NSArray<PSPDFAnnotationGroupItem *> *)items
                choice:(NSUInteger)choice;
  • All set items. - see: editableItems

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) NSArray<PSPDFAnnotationGroupItem *> *_Nonnull items;
  • The items filtered to only editable types. The editable types are set by the hosting annotation toolbar.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<PSPDFAnnotationGroupItem *> *_Nonnull editableItems;
  • The index of the currently selected item.

    Note

    This corresponds to an index in editableItems. Indexes outside of the editableItems range will be automatically adjusted.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger choice;
  • Updates the choice index to the first item with the selected type and variant. Set variant to nil, if not relevant. Returns true is successful and false if no items with the provided parameters were found.

    Declaration

    Objective-C

    - (BOOL)updateChoiceToItemWithType:(nonnull PSPDFAnnotationString)type
                               variant:
                                   (nullable PSPDFAnnotationVariantString)variant;