PSPDFSelectionState

Objective-C


@interface PSPDFSelectionState : NSObject <NSSecureCoding>

Swift

class SelectionState : NSObject, NSSecureCoding

Contains information about the currently selected state on a page.

  • Returns an instance of the receiver configured to match the selectionView argument’s state, if a selection exists.

    Declaration

    Objective-C

    + (nullable instancetype)stateForSelectionView:
        (nonnull PSPDFTextSelectionView *)selectionView;

    Swift

    convenience init?(for selectionView: PSPDFTextSelectionView)
  • UID

    The uid of the document which the receiver corresponds to.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull UID;

    Swift

    var uid: String { get }
  • The page index on which the selection exists.

    Declaration

    Objective-C

    @property (nonatomic, readonly) PSPDFPageIndex selectionPageIndex;

    Swift

    var selectionPageIndex: PageIndex { get }
  • The range of glyphs (in PSPDFTextParser.glyphs) that are selected. If no glyphs are selected, this method returns PSPDFInvalidGlyphRange.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSRange selectedGlyphRange;

    Swift

    var selectedGlyphRange: NSRange { get }
  • The info for the selected image, if any.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) PSPDFImageInfo *selectedImage;

    Swift

    var selectedImage: PSPDFImageInfo? { get }
  • Returns a Boolean value that indicates whether a selection state is equal to the receiver.

    Declaration

    Objective-C

    - (BOOL)isEqualToSelectionState:(nullable PSPDFSelectionState *)selectionState;

    Swift

    func isEqual(to selectionState: SelectionState?) -> Bool

    Parameters

    selectionState

    The selection with which to compare the receiver

    Return Value

    YES is selectionState is equivalent to the receiver, otherwise NO.