PTAnnotStyle

@interface PTAnnotStyle : NSObject <NSCopying, NSCoding, PTOverridable>

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

    convenience 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:(nullable PTPDFDoc *)pdfDoc;

    Swift

    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.

  • Returns a new instance of an AnnotStyle.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoder:(nonnull NSCoder *)coder;

    Swift

    init(coder: NSCoder)

    Parameters

    coder

    The coder used to initialize this object’s properties.

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

    Declaration

    Objective-C

    @property (nonatomic, readonly) PTExtendedAnnotType annotType;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly)
        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 (nonatomic, strong, readwrite, nullable) UIColor *color;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite) 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 (nonatomic, assign, unsafe_unretained, readwrite)
        BOOL saveValuesAsDefaults;

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly) 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()
  • Apply the current style properties to the given annotation.

    Declaration

    Objective-C

    - (void)applyToAnnotation:(nonnull PTAnnot *)annotation;

    Swift

    func apply(toAnnotation annotation: PTAnnot)
  • Apply the current style properties to the given annotation and document.

    Declaration

    Objective-C

    - (void)applyToAnnotation:(nonnull PTAnnot *)annotation
                          doc:(nullable PTPDFDoc *)doc;

    Swift

    func apply(toAnnotation annotation: PTAnnot, doc: PTPDFDoc?)
  • 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 (nonatomic, weak, readwrite, nullable) id<PTAnnotStyleDelegate>
        delegate;

    Swift

    weak var delegate: PTAnnotStyleDelegate? { get set }
  • Compares the receiving annotation style instance to another instance.

    Declaration

    Objective-C

    - (BOOL)isEqualToAnnotStyle:(nonnull PTAnnotStyle *)annotStyle;

    Swift

    func isEqual(to annotStyle: PTAnnotStyle) -> Bool

    Parameters

    annotStyle

    an other annotation style instance

    Return Value

    YES if the annotation style instance is equal to the receiving instance, otherwise NO