PTSelectionRectContainerView


@interface PTSelectionRectContainerView : UIView <PTOverridable>

A transparent container view for the shaded PTSelectionRectView and the resize widgets.

  • Initializes a new PTSelectionRectContainerView instance.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPDFViewCtrl:(nonnull PTPDFViewCtrl *)pdfViewCtrl
                                       forAnnot:(nullable PTAnnot *)annot
                              withAnnotEditTool:(nonnull PTAnnotEditTool *)tool;

    Swift

    init(pdfViewCtrl: PTPDFViewCtrl, for annot: PTAnnot?, with tool: PTAnnotEditTool)

    Parameters

    pdfViewCtrl

    The PTPDFViewCtrl instance that this view uses.

    annot

    The annotation that this view will be shown over, or nil.

    tool

    The current tool.

    Return Value

    An initialized PTSelectionRectContainerView instance.

  • The shaded rectangle that is overlayed onto the selected annotation.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) PTSelectionRectView *_Nonnull selectionRectView;

    Swift

    var selectionRectView: PTSelectionRectView { get }
  • The rectangle that covers the group of annotations

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIView *_Nonnull groupSelectionRectView;

    Swift

    var groupSelectionRectView: UIView { get }
  • The rectangle that draws the line between control resize widgets

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UIView *_Nonnull borderView;

    Swift

    var borderView: UIView { get }
  • The PTPDFViewCtrl that the selection is on.

    Declaration

    Objective-C

    @property (nonatomic, weak) PTPDFViewCtrl *_Nullable pdfViewCtrl;

    Swift

    weak var pdfViewCtrl: PTPDFViewCtrl? { get set }
  • The margin between the border and the selection.

    Note

    The default value of this property is 20pt.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat selectionRectMargin;

    Swift

    var selectionRectMargin: CGFloat { get set }
  • The width of the border drawn around the selection.

    Note

    The default value of this property is 1.0pt.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat borderWith;

    Swift

    var borderWith: CGFloat { get set }
  • The corner radius of the border drawn around the selection.

    Note

    The default value of this property is 0.0.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat borderCornerRadius;

    Swift

    var borderCornerRadius: CGFloat { get set }
  • When true, only displays corner resize handles. Default is false.

    Declaration

    Objective-C

    @property (nonatomic) BOOL displaysOnlyCornerResizeHandles;

    Swift

    var displaysOnlyCornerResizeHandles: Bool { get set }
  • Hides all of the resize widgets.

    Declaration

    Objective-C

    - (void)hideResizeWidgetViews;

    Swift

    func hideResizeWidgetViews()
  • Shows all of the resize widgets.

    Declaration

    Objective-C

    - (void)showResizeWidgetViews;

    Swift

    func showResizeWidgetViews()
  • Shows the width resize widget (for spacing texts).

    Declaration

    Objective-C

    - (void)showWidthResizeWidgetView;

    Swift

    func showWidthResizeWidgetView()
  • Used to set the view’s frame to match the selected annotation’s frame.

    Declaration

    Objective-C

    - (void)setFrameFromAnnot:(CGRect)frame;

    Swift

    func setFrameFromAnnot(_ frame: CGRect)

    Parameters

    frame

    The view’s new frame.

  • The text view used for free text annotation editing.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) PTFreeTextView *textView;

    Swift

    var textView: PTFreeTextView? { get set }
  • The text view presented when a spacing text annotation is selected.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) PTFreeTextView *spacingTextView;

    Swift

    var spacingTextView: PTFreeTextView? { get set }
  • Scales the text size of a free text annotation that’s being edited for the current zoom.

    Declaration

    Objective-C

    - (void)setEditTextSizeForZoom:(double)zoom forFontSize:(int)size;

    Swift

    func setEditTextSizeForZoom(_ zoom: Double, forFontSize size: Int32)
  • Adds a UITextView to the selection rectangle for PTFreeText annotation editing.

    Declaration

    Objective-C

    - (void)useTextViewWithText:(nullable NSString *)text
                  withAlignment:(int)alignment
                         atZoom:(double)zoom
                    forFontSize:(int)size
                   withFontName:(nonnull NSString *)fontName
                      withFrame:(CGRect)frame
                   withDelegate:(nonnull id<UITextViewDelegate>)delegateView;

    Swift

    func useTextView(withText text: String?, withAlignment alignment: Int32, atZoom zoom: Double, forFontSize size: Int32, withFontName fontName: String, withFrame frame: CGRect, with delegateView: any UITextViewDelegate)
  • Adds a UITextView to the selection rectangle for PTFreeText annotation editing.

    Declaration

    Objective-C

    - (void)
        useTextViewWithAttributedText:(nullable NSAttributedString *)attributedText
                        withAlignment:(int)alignment
                               atZoom:(double)zoom
                          forFontSize:(int)size
                         withFontName:(nonnull NSString *)fontName
                            withFrame:(CGRect)frame
                         withDelegate:(nonnull id<UITextViewDelegate>)delegateView;

    Swift

    func useTextView(withAttributedText attributedText: NSAttributedString?, withAlignment alignment: Int32, atZoom zoom: Double, forFontSize size: Int32, withFontName fontName: String, withFrame frame: CGRect, with delegateView: any UITextViewDelegate)
  • Undocumented

    Declaration

    Objective-C

    - (void)useTextViewForSpacingText:(nullable NSString *)text withAlignment:(int)alignment atZoom:(double)zoom forFontSize:(int)size withFontName:(NSString*)fontName withFrame:(CGRect)frame;

    Swift

    func useTextView(forSpacingText text: String?, withAlignment alignment: Int32, atZoom zoom: Double, forFontSize size: Int32, withFontName fontName: String, withFrame frame: CGRect)
  • Undocumented

    Declaration

    Objective-C

    - (void)useTextViewForSpacingAttributedText:(nullable NSAttributedString *)attributedText withAlignment:(int)alignment atZoom:(double)zoom forFontSize:(int)size withFontName:(NSString*)fontName withFrame:(CGRect)frame;

    Swift

    func useTextView(forSpacingAttributedText attributedText: NSAttributedString?, withAlignment alignment: Int32, atZoom zoom: Double, forFontSize size: Int32, withFontName fontName: String, withFrame frame: CGRect)
  • Saves any changes made to a PTFreeText back to the PTPDFDoc.

    Declaration

    Objective-C

    - (void)setAnnotationContents:(nonnull PTAnnot *)annot;

    Swift

    func setAnnotationContents(_ annot: PTAnnot)

    Parameters

    annot

    The annotation that is selected.

  • Shows the selection rect. For use when editing line and arrow annotations, where the selection rectangle is not shown when the annotation is not being moved, and has a different appearance than other annotation types.

    Declaration

    Objective-C

    - (void)showSelectionRect;

    Swift

    func showSelectionRect()
  • Hides the selection rect. For use when editing line and arrow annotations, where the selection rectangle is not shown when the annotation is not being moved, and has a different appearance than other annotation types.

    Declaration

    Objective-C

    - (void)hideSelectionRect;

    Swift

    func hideSelectionRect()
  • Sets the annot type that is selected. Used to determine the appearance of the child PTSelectionRectView.

    Declaration

    Objective-C

    - (void)setAnnot:(nullable PTAnnot *)annot pageNumber:(int)pageNumber;

    Swift

    func setAnnot(_ annot: PTAnnot?, pageNumber: Int32)

    Parameters

    annot

    The annotation that is selected.

    pageNumber

    The PDF page number of the annotation.

  • Refreshes the live representation of the annotation’s appearance.

    Declaration

    Objective-C

    - (void)refreshLiveAppearance;

    Swift

    func refreshLiveAppearance()
  • Removes the live representation of the annotation’s appearance.

    Declaration

    Objective-C

    - (void)removeLiveAppearance;

    Swift

    func removeLiveAppearance()
  • Undocumented

    Declaration

    Objective-C

    -(instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    -(instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    -(instancetype)init NS_UNAVAILABLE;