Mac Developer Library

Developer

WebKit Framework Reference WebDocumentSearching Protocol Reference

Options
Deployment Target:

On This Page
Language:

WebDocumentSearching

Inheritance


Not Applicable

Conforms To


Import Statement


Swift

import WebKit

Objective-C

@import WebKit;

Availability


Available in OS X v10.2 with Safari 1.0 and later.
Available in OS X v10.2.7 and later.

WebDocumentSearching is an optional protocol for document view objects that support searching. Classes that adopt this protocol should also adopt WebDocumentView and inherit from NSView.

  • Searches for a string in a given direction from the current position.

    Declaration

    Swift

    func searchFor(_ string: String!, direction directionFlag: Bool, caseSensitive caseFlag: Bool, wrap wrapFlag: Bool) -> Bool

    Objective-C

    - (BOOL)searchFor:(NSString *)string direction:(BOOL)directionFlag caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag

    Parameters

    string

    The string to search for.

    directionFlag

    If YEStrue, the search is in the forward direction from the current location; otherwise, the search is in the backward direction.

    caseFlag

    If YEStrue then the search is case sensitive; otherwise, it is not.

    wrapFlag

    If YEStrue, the search continues from the end of the document to the current location; otherwise, it stops at the end of the document.

    Return Value

    YEStrue if the receiver contains string in the specified direction; otherwise, NOfalse.

    Discussion

    The receiver should select the string if it is found.

    Import Statement

    Objective-C

    @import WebKit;

    Swift

    import WebKit

    Availability

    Available in OS X v10.2 with Safari 1.0 and later.

    Available in OS X v10.2.7 and later.