PSPDFSearchResult
Objective-C
@interface PSPDFSearchResult : PSPDFModel
Swift
class SearchResult : ModelObject
Represents an immutable search result from PSPDFTextSearch
-
Designated initializer.
Declaration
Objective-C
- (nonnull instancetype)initWithDocumentUID:(nonnull NSString *)documentUID pageIndex:(PSPDFPageIndex)pageIndex range:(NSRange)range previewText:(nonnull NSString *)previewText rangeInPreviewText:(NSRange)rangeInPreviewText selection:(nullable PSPDFTextBlock *)selection annotation: (nullable PSPDFAnnotation *)annotation;
Swift
init(documentUID: String, pageIndex: PageIndex, range: NSRange, previewText: String, rangeInPreviewText: NSRange, selection: PSPDFTextBlock?, annotation: Annotation?)
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithDocument:(PSPDFDocument *)document pageIndex:(PSPDFPageIndex)pageIndex range:(NSRange)range previewText:(NSString *)previewText rangeInPreviewText:(NSRange)rangeInPreviewText selection:(nullable PSPDFTextBlock *)selection annotation:(nullable PSPDFAnnotation *)annotation;
Swift
convenience init(document: PSPDFDocument, pageIndex: PageIndex, range: NSRange, previewText: String, rangeInPreviewText: NSRange, selection: PSPDFTextBlock?, annotation: Annotation?)
-
Referenced page.
Declaration
Objective-C
@property (nonatomic, readonly) PSPDFPageIndex pageIndex;
Swift
var pageIndex: PageIndex { get }
-
Preview text snippet.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull previewText;
Swift
var previewText: String { get }
-
Range of the search result in relation to the previewText.
Declaration
Objective-C
@property (nonatomic, readonly) NSRange rangeInPreviewText;
Swift
var rangeInPreviewText: NSRange { get }
-
Range within full page text.
Declaration
Objective-C
@property (nonatomic, readonly) NSRange range;
Swift
var range: NSRange { get }
-
Text coordinates. Usually the text block contains only one word, unless the search is split across two lines.
Note
This property is optional.Declaration
Objective-C
@property (nonatomic, readonly, nullable) PSPDFTextBlock *selection;
Swift
var selection: PSPDFTextBlock? { get }
-
If the search result references an annotation, the object is set.
Note
This property is only set if the search result points to an annotation.Declaration
Objective-C
@property (nonatomic, weak, readonly) PSPDFAnnotation *_Nullable annotation;
Swift
weak var annotation: Annotation? { get }
-
The UID of the referenced document.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull documentUID;
Swift
var documentUID: String { get }
-
Referenced document.
Declaration
Objective-C
@property (nonatomic, weak, readonly) PSPDFDocument *_Nullable document;
Swift
weak var document: PSPDFDocument? { get }