Protocol: UIAccessibilityReadingContent

Overview

The UIAccessibilityReadingContent protocol can be implemented on an object that represents content that is intended to be read by users, such as a book or an article. To give VoiceOver users a superior, continuous reading experience, you can implement this protocol on such an element, characterize it with the UIAccessibilityTraitCausesPageTurn trait, and use the UIAccessibilityScrollDirectionNext and UIAccessibilityScrollDirectionPrevious constants to enable page turning.Returns the text associated with the specified line number. (required)Returns the onscreen frame associated with the specified line number. (required)Returns the line number that contains the specified point. (required)Returns the text displayed on the current page. (required)

Instance Method Summary (collapse)

Instance Method Details

- (String) accessibilityContentForLineNumber(lineNumber)

Returns the text associated with the specified line number. (required)

Parameters:

  • lineNumber (Integer)

    A line number in the receiver’s content.

Returns:

  • (String)

    A string containing the text that is associated with the specified line number, or nil if the line number is invalid. By default, this function returns nil.

- (CGRect) accessibilityFrameForLineNumber(lineNumber)

Returns the onscreen frame associated with the specified line number. (required) To determine the onscreen rectangle (or frame) of a line, you can use code such as the following:

Parameters:

  • lineNumber (Integer)

    The line number.

Returns:

  • (CGRect)

    The frame in the receiver that contains the specified line number, in screen coordinates. By default, this method returns CGRectZero.

- (Integer) accessibilityLineNumberForPoint(point)

Returns the line number that contains the specified point. (required) This method is called only when point is within the bounds of the view or element.

Parameters:

  • point (CGPoint)

    A point within the bounds of the receiver’s view space, in screen coordinates. That is, a point for which [self pointInside:point withEvent:event] == YES.

Returns:

  • (Integer)

    The line number that contains the specified point or NSNotFound if the point indicates an empty area within the receiver’s rectangle. By default, this method returns NSNotFound.

- (String) accessibilityPageContent

Returns the text displayed on the current page. (required)

Returns:

  • (String)

    A string that contains the text displayed on the current page.