PSPDFAnnotationGroup


@interface PSPDFAnnotationGroup : PSPDFModel

Used to configure custom annotation groups for the annotation toolbar. - see: PSPDFAnnotationToolbarConfiguration for details.

@code [[PSPDFAnnotationToolbarConfiguration alloc] initWithAnnotationGroups:@[

[PSPDFAnnotationGroup groupWithItems:@[ [PSPDFAnnotationGroupItem itemWithType:PSPDFAnnotationStringInk variant:PSPDFAnnotationStringInkVariantPen configurationBlock:[PSPDFAnnotationGroupItem inkConfigurationBlock]]]],

[PSPDFAnnotationGroup groupWithItems:@[ [PSPDFAnnotationGroupItem itemWithType:PSPDFAnnotationStringLine], [PSPDFAnnotationGroupItem itemWithType:PSPDFAnnotationStringPolyLine]]] ]]; @endcode

  • 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 instancetype)groupWithItems:
        (nonnull NSArray<__kindof PSPDFAnnotationGroupItem *> *)items;

    Swift

    convenience init(items: [PSPDFAnnotationGroupItem])
  • 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 instancetype)
    groupWithItems:(nonnull NSArray<__kindof PSPDFAnnotationGroupItem *> *)items
            choice:(NSUInteger)choice;

    Swift

    convenience init(items: [PSPDFAnnotationGroupItem], choice: UInt)
  • All set items. - see: editableItems

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<__kindof PSPDFAnnotationGroupItem *> *_Nonnull items;

    Swift

    var items: [PSPDFAnnotationGroupItem] { get }
  • The items filtered to only editable types. The editable types are set by the hosting annotation toolbar.

    Declaration

    Objective-C

    @property (readonly, nonatomic)
        NSArray<__kindof PSPDFAnnotationGroupItem *> *_Nonnull editableItems;

    Swift

    var editableItems: [PSPDFAnnotationGroupItem] { get }
  • 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 (assign, readwrite, nonatomic) NSUInteger choice;

    Swift

    var choice: UInt { get set }
  • Updates the choice index to the first item with the selected type and variant. Set variant to nil, if not relevant. Returns YES is successful and NO if no items with the provided parameters were found.

    Declaration

    Objective-C

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

    Swift

    func updateChoiceToItem(withType type: PSPDFAnnotationString, variant: PSPDFAnnotationString?) -> Bool