PSPDFAnnotationGroupItem


@interface PSPDFAnnotationGroupItem : PSPDFModel

An annotation group items defines one annotation type, optionally with a variant.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    PSPDF_EMPTY_INIT_UNAVAILABLE
  • Creates a group item with the specified annotation type.

    See

    itemWithType:variant:configurationBlock:

    Declaration

    Objective-C

    + (nonnull instancetype)itemWithType:(nonnull PSPDFAnnotationString)type;

    Swift

    convenience init(type: AnnotationString)
  • Creates a group item with the specified annotation type and optional variant identifier.

    See

    itemWithType:variant:configurationBlock:

    Declaration

    Objective-C

    + (nonnull instancetype)itemWithType:(nonnull PSPDFAnnotationString)type
                                 variant:
                                     (nullable PSPDFAnnotationVariantString)variant;

    Swift

    convenience init(type: AnnotationString, variant: AnnotationVariantString?)
  • Creates a group item with the specified annotation type, an optional variant identifier and configuration block.

    Note

    Whenever possible try to return a template image from the configuration block (UIImageRenderingModeAlwaysTemplate). Use the provided tint color only when you need multi-color images.

    Declaration

    Objective-C

    + (nonnull instancetype)
          itemWithType:(nonnull PSPDFAnnotationString)type
               variant:(nullable PSPDFAnnotationVariantString)variant
    configurationBlock:(nonnull PSPDFAnnotationGroupItemConfigurationBlock)block;

    Swift

    convenience init(type: AnnotationString, variant: AnnotationVariantString?, configurationBlock block: @escaping PSPDFAnnotationGroupItemConfigurationBlock)

    Parameters

    type

    The annotation type.

    variant

    An optional annotation string for the item variant. Use variants to add several instances of the same tool with uniquely preservable annotation style settings.

    block

    An option block, that should return the button’s image. If nil, defaultConfigurationBlock is used.

  • A block that configures an preset image based on the annotation type.

    Note

    The annotation images are loaded using -[PSPDFKit imageNamed:], which means that you either need to supply your own icons to that method, use a custom configuration block, or link to PSPDFKitUI.framework, if you want to use the default bundled annotation toolbar icons.

    Declaration

    Objective-C

    + (nonnull PSPDFAnnotationGroupItemConfigurationBlock)defaultConfigurationBlock;

    Swift

    class func defaultConfigurationBlock() -> PSPDFAnnotationGroupItemConfigurationBlock
  • The set annotation type.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) PSPDFAnnotationString _Nonnull type;

    Swift

    var type: AnnotationString { get }
  • The annotation variant, if set during initialization.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable)
        PSPDFAnnotationVariantString variant;

    Swift

    var variant: AnnotationVariantString? { get }
  • Used to generate the annotation image. Will be defaultConfigurationBlock or inkConfigurationBlock in most cases.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        PSPDFAnnotationGroupItemConfigurationBlock _Nonnull configurationBlock;

    Swift

    var configurationBlock: PSPDFAnnotationGroupItemConfigurationBlock { get }