PSPDFRotatable

Objective-C

@protocol PSPDFRotatable <NSObject>

Swift

protocol Rotatable : NSObjectProtocol

Annotations that can be rotated conform to this protocol.

  • The counterclockwise angle of the annotation relative to the page, in degrees. The angle should be between 0 and 359. Defaults to 0.

    To set the rotation, use setRotation(_:, updateBoundingBox:).

    Declaration

    Objective-C

    @property (readonly) NSUInteger rotation;

    Swift

    var rotation: UInt { get }
  • Sets the rotation property, optionally updating the boundingBox to preserve the content size.

    Updating the boundingBox of the annotation will ensure it encloses the content while preserving the content size and center, without distorting the annotation.

    Not updating the boundingBox would in general distort the annotation, but in some cases it is required to get the correct results, such as during setup.

    Declaration

    Objective-C

    - (void)setRotation:(NSUInteger)rotation
        updateBoundingBox:(BOOL)shouldUpdateBoundingBoxToMaintainContentSize;

    Swift

    func setRotation(_ rotation: UInt, updateBoundingBox shouldUpdateBoundingBoxToMaintainContentSize: Bool)

    Parameters

    rotation

    The new value for the rotation property. This should be between 0 and 359.

    shouldUpdateBoundingBoxToMaintainContentSize

    If true the boundingBox will be updated to preserve the content size.