PTAnnotStyle

@interface PTAnnotStyle : NSObject

This class wraps a PTAnnot and is used to store style appearance and property information before the information is saved back to the annotation.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnotType:(PTExtendedAnnotType)annotType;

    Swift

    init(annotType: PTExtendedAnnotType)

    Parameters

    annotType

    The annotation type used to initalize this object’s properties.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnot:(nonnull PTAnnot *)annot;

    Swift

    init(annot: PTAnnot)

    Parameters

    annot

    The annotation used to initialize this object’s properties.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAnnot:(nonnull PTAnnot *)annot
                                 onPDFDoc:(nonnull PTPDFDoc *)pdfDoc;

    Swift

    convenience init(annot: PTAnnot, on pdfDoc: PTPDFDoc)

    Parameters

    annot

    The annotation used to initialize this object’s properties.

    pdfDoc

    The PTPDFDoc which the annotation is part of. This is required to change a PTFreeText‘s font.

  • The annotation type whose style appearance and properties are being controlled by this object.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PTExtendedAnnotType annotType;

    Swift

    var annotType: PTExtendedAnnotType { get }
  • The annotation whose style appearance and properties are being controlled by this object.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) PTAnnot *annot;

    Swift

    var annot: PTAnnot? { get }
  • A list of the currently available style keys for the annotation type.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<PTAnnotStyleKey> *_Nonnull availableStyleKeys;

    Swift

    var availableStyleKeys: [PTAnnotStyleKey] { get }
  • The color of the annotation. This is also an alias for the stroke color.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIColor *color;

    Swift

    var color: UIColor? { get set }
  • The stroke color of the annotation.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIColor *strokeColor;

    Swift

    var strokeColor: UIColor? { get set }
  • The fill color of the annotation.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIColor *fillColor;

    Swift

    var fillColor: UIColor? { get set }
  • The text color of a free text annotation.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIColor *textColor;

    Swift

    var textColor: UIColor? { get set }
  • The line, stroke, or border thickness of the annotation.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat thickness;

    Swift

    var thickness: CGFloat { get set }
  • The opacity of the annotation.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat opacity;

    Swift

    var opacity: CGFloat { get set }
  • The text size of a free text annotation.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat textSize;

    Swift

    var textSize: CGFloat { get set }
  • The font descriptor to use to choose the free text font.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull fontName;

    Swift

    var fontName: String { get set }
  • The label applied to the annotation.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *label;

    Swift

    var label: String? { get set }
  • The measurement scale for a measurement annotation.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        PTMeasurementScale *measurementScale;

    Swift

    var measurementScale: PTMeasurementScale? { get set }
  • Whether measurement tool snapping is enabled.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL snappingEnabled;

    Swift

    var snappingEnabled: Bool { get set }
  • Whether saveChanges also saves the current style properties as the defaults for the annotation type.

    The default valus is YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL saveValuesAsDefaults;

    Swift

    var saveValuesAsDefaults: Bool { get set }
  • A calculated convenience string used for displaying the current thickness.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSString *_Nonnull thicknessIndicatorString;

    Swift

    var thicknessIndicatorString: String { get }
  • A calculated convenience string used for displaying the current opacity.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull opacityIndicatorString;

    Swift

    var opacityIndicatorString: String { get }
  • A calculated convenience string used for displaying the current text size.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull textSizeIndicatorString;

    Swift

    var textSizeIndicatorString: String { get }
  • Save the current style properties back to the annotation.

    Declaration

    Objective-C

    - (void)saveChanges;

    Swift

    func saveChanges()
  • Set the current style properties as the defaults for the annotation type.

    Declaration

    Objective-C

    - (void)setCurrentValuesAsDefaults;

    Swift

    func setCurrentValuesAsDefaults()
  • An object that conforms to the AnnotStyleDelegate protocol.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<PTAnnotStyleDelegate> delegate;

    Swift

    weak var delegate: PTAnnotStyleDelegate? { get set }