iOS Developer Library

Developer

UIKit Framework Reference UITextSelectionRect Class Reference

Options
Deployment Target:

On This Page
Language:

UITextSelectionRect

Inherits From


Conforms To


Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 6.0 and later

The UITextSelectionRect class encapsulates information about a selected range of text in a document. This class is an abstract class and must be subclassed to be used. The system text input views provide their own concrete implementations of this class.

Subclassing Notes

If you are implementing a custom text input view, you can subclass and use your custom class to return selection-related information. When subclassing, you should override and reimplement all properties. In your custom implementations, do not call super.

  • rect rect Property

    The rectangle that encloses the receiver’s text range. (read-only)

    Declaration

    Swift

    var rect: CGRect { get }

    Objective-C

    @property(nonatomic, readonly) CGRect rect

    Discussion

    The returned rectangle is in the coordinate system of the text input view that created the receiver.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The writing direction of text in the receiver’s text range. (read-only)

    Declaration

    Swift

    var writingDirection: UITextWritingDirection { get }

    Objective-C

    @property(nonatomic, readonly) UITextWritingDirection writingDirection

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • A Boolean value indicating whether the text is oriented vertically. (read-only)

    Declaration

    Swift

    var isVertical: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL isVertical

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • A Boolean value indicating whether the rectangle contains the start of the selection. (read-only)

    Declaration

    Swift

    var containsStart: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL containsStart

    Discussion

    The value of this property is used to determine the placement of the selection handles in bidirectional text. It provides a clue to the system about whether the start of the selection is in the specified rectangle.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • A Boolean value indicating whether the rectangle contains the end of the selection. (read-only)

    Declaration

    Swift

    var containsEnd: Bool { get }

    Objective-C

    @property(nonatomic, readonly) BOOL containsEnd

    Discussion

    The value of this property is used to determine the placement of the selection handles in bidirectional text. It provides a clue to the system about whether the end of the selection is in the specified rectangle.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later