PSPDFResizableView


@interface PSPDFResizableView : UIView

A view that shows borders around selected annotations, with handles the user can use to resize the annotation. The handle and border color is determined by the tintColor property inherited from UIView.

  • Delegate called on frame change.

    Declaration

    Objective-C

    @property (readwrite, nonatomic)
        id<PSPDFResizableViewDelegate> _Nullable delegate;

    Swift

    @IBOutlet weak var delegate: PSPDFResizableViewDelegate? { get set }
  • The mode that the resizable view is currently in.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) PSPDFResizableViewMode mode;

    Swift

    var mode: PSPDFResizableViewMode { get set }
  • View that will be changed on selection change.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSSet<UIView *> *trackedViews;

    Swift

    var trackedViews: Set
  • Set zoom scale to be able to draw the page knobs at the correct size.

    Declaration

    Objective-C

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

    Swift

    var zoomScale: CGFloat { get set }
  • The inner edge insets are used to create space between the bounding box (blue) and tracked view. They will be applied to the content frame in addition to outerEdgeInsets to calculate frame. Use negative values to add space around the tracked annotation view. Defaults to -20.f for top, bottom, right, and left. - note: updateAnnotationSelectionView in PSPDFPageView is used to set the inner edge insets of not resizable annotations (e.g. note annotations) to -2.f for top, bottom, right, and left (ignoring the innerEdgeInsets property). If you want to change this, you need to subclass PSPDFPageView and overwrite updateAnnotationSelectionView.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) UIEdgeInsets innerEdgeInsets;

    Swift

    var innerEdgeInsets: UIEdgeInsets { get set }
  • The outer edge insets are used to create space between the bounding box (blue) and the view bounds. They will be applied to the content frame in addition to innerEdgeInsets to calculate frame. Use negative values to add space around the tracked annotation view. Defaults to -40.0f for top, bottom, right, and left.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) UIEdgeInsets outerEdgeInsets;

    Swift

    var outerEdgeInsets: UIEdgeInsets { get set }
  • If set to NO, won’t show selection knobs and dragging. Defaults to YES.

    Declaration

    Objective-C

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

    Swift

    var allowEditing: Bool { get set }
  • Allows view resizing, shows resize knobs. If set to NO, view can only be moved or adjusted, no resize knobs will be displayed. Depends on allowEditing. Defaults to YES.

    Declaration

    Objective-C

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

    Swift

    var allowResizing: Bool { get set }
  • Allows view adjusting, shows knobs to move single points. If set to NO, view can only be moved or resized, no adjust knobs will be displayed. Depends on allowEditing. Defaults to YES.

    Declaration

    Objective-C

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

    Swift

    var allowAdjusting: Bool { get set }
  • Enables resizing helper so that aspect ration can be preserved easily. Defaults to YES.

    Declaration

    Objective-C

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

    Swift

    var enableResizingGuides: Bool { get set }
  • Shows the bounding box. Defaults to YES.

    Declaration

    Objective-C

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

    Swift

    var showBoundingBox: Bool { get set }
  • Defines how aggressively the guide works. Defaults to 20.f. Set to PSPDFGuideSnapAllowanceAlways if you want to always snap to guides.

    Declaration

    Objective-C

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

    Swift

    var guideSnapAllowance: CGFloat { get set }
  • Override the minimum allowed width. This value is ignored if the view is smaller to begin with or the annotation specifies a bigger minimum width. Default is 0.f.

    Declaration

    Objective-C

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

    Swift

    var minWidth: CGFloat { get set }
  • Override the minimum allowed height. This value is ignored if the view is smaller to begin with or the annotation specifies a bigger minimum height. Default is 0.f.

    Declaration

    Objective-C

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

    Swift

    var minHeight: CGFloat { get set }
  • Border size. Defaults to 1.f

    Declaration

    Objective-C

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

    Swift

    var selectionBorderWidth: CGFloat { get set }
  • Guide color. Defaults to UIColor.pspdf_guideColor.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) UIColor *guideBorderColor;

    Swift

    var guideBorderColor: UIColor? { get set }
  • Corner radius size. Defaults to 2.f.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger cornerRadius;

    Swift

    var cornerRadius: UInt { get set }
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFResizableView : UIView
  • All knobs. Can be hidden individually. Note that properties like allowEditing/allowResizing will update the hidden property. To properly hide a knob, remove it from the superview.

    Declaration

    Objective-C

    - (nullable UIView<PSPDFKnobView> *)outerKnobOfType:
        (PSPDFResizableViewOuterKnob)knobType;

    Swift

    func outerKnob(ofType knobType: PSPDFResizableViewOuterKnob) -> UIView?
  • Allows to customize the position for a knob.

    Declaration

    Objective-C

    - (CGPoint)centerPointForOuterKnob:(PSPDFResizableViewOuterKnob)knobType
                               inFrame:(CGRect)frame;

    Swift

    func centerPoint(for knobType: PSPDFResizableViewOuterKnob, inFrame frame: CGRect) -> CGPoint

    Parameters

    knobType

    The knob whoes center position should be calculated.

    frame

    The frame in which the knob is positioned. Usually this is self.bounds, but during resizing, this might be different.

    Return Value

    The center point of where the knob view should be drawn.

  • Creates and configures a new knob view.

    Declaration

    Objective-C

    - (nonnull UIView<PSPDFKnobView> *)newKnobViewForType:(PSPDFKnobType)type;

    Swift

    func newKnobView(for type: PSPDFKnobType) -> UIView
  • Undocumented

    Declaration

    Objective-C

    
    @interface PSPDFResizableView : UIView
  • Update the knobs.

    Declaration

    Objective-C

    - (void)updateKnobsAnimated:(BOOL)animated;

    Swift

    func updateKnobs(animated: Bool)
  • The guide layer is used to present the border around annotations. We have great defaults but subclassing this can be used to change the style. - warning: Do NOT override drawRect: in this class, as it will consume a lot of memory when zoomed in.

    Declaration

    Objective-C

    - (void)configureGuideLayer:(nonnull CAShapeLayer *)layer
                  withZoomScale:(CGFloat)zoomScale;

    Swift

    func configureGuideLayer(_ layer: CAShapeLayer, withZoomScale zoomScale: CGFloat)