UITextInput

Trait UITextInput 

Source
pub unsafe trait UITextInput: UIKeyInput + MainThreadOnly {
Show 63 methods // Provided methods fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>> where Self: Sized + Message { ... } fn replaceRange_withText(&self, range: &UITextRange, text: &NSString) where Self: Sized + Message { ... } fn selectedTextRange(&self) -> Option<Retained<UITextRange>> where Self: Sized + Message { ... } fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>) where Self: Sized + Message { ... } fn markedTextRange(&self) -> Option<Retained<UITextRange>> where Self: Sized + Message { ... } fn markedTextStyle( &self, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>> where Self: Sized + Message { ... } unsafe fn setMarkedTextStyle( &self, marked_text_style: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>, ) where Self: Sized + Message { ... } fn setMarkedText_selectedRange( &self, marked_text: Option<&NSString>, selected_range: NSRange, ) where Self: Sized + Message { ... } fn unmarkText(&self) where Self: Sized + Message { ... } fn beginningOfDocument(&self) -> Retained<UITextPosition> where Self: Sized + Message { ... } fn endOfDocument(&self) -> Retained<UITextPosition> where Self: Sized + Message { ... } fn textRangeFromPosition_toPosition( &self, from_position: &UITextPosition, to_position: &UITextPosition, ) -> Option<Retained<UITextRange>> where Self: Sized + Message { ... } fn positionFromPosition_offset( &self, position: &UITextPosition, offset: NSInteger, ) -> Option<Retained<UITextPosition>> where Self: Sized + Message { ... } fn positionFromPosition_inDirection_offset( &self, position: &UITextPosition, direction: UITextLayoutDirection, offset: NSInteger, ) -> Option<Retained<UITextPosition>> where Self: Sized + Message { ... } fn comparePosition_toPosition( &self, position: &UITextPosition, other: &UITextPosition, ) -> NSComparisonResult where Self: Sized + Message { ... } fn offsetFromPosition_toPosition( &self, from: &UITextPosition, to_position: &UITextPosition, ) -> NSInteger where Self: Sized + Message { ... } fn inputDelegate( &self, ) -> Option<Retained<ProtocolObject<dyn UITextInputDelegate>>> where Self: Sized + Message { ... } fn setInputDelegate( &self, input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>>, ) where Self: Sized + Message { ... } fn tokenizer(&self) -> Retained<ProtocolObject<dyn UITextInputTokenizer>> where Self: Sized + Message { ... } fn positionWithinRange_farthestInDirection( &self, range: &UITextRange, direction: UITextLayoutDirection, ) -> Option<Retained<UITextPosition>> where Self: Sized + Message { ... } fn characterRangeByExtendingPosition_inDirection( &self, position: &UITextPosition, direction: UITextLayoutDirection, ) -> Option<Retained<UITextRange>> where Self: Sized + Message { ... } fn baseWritingDirectionForPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> NSWritingDirection where Self: Sized + Message { ... } fn setBaseWritingDirection_forRange( &self, writing_direction: NSWritingDirection, range: &UITextRange, ) where Self: Sized + Message { ... } fn firstRectForRange(&self, range: &UITextRange) -> CGRect where Self: Sized + Message { ... } fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect where Self: Sized + Message { ... } fn selectionRectsForRange( &self, range: &UITextRange, ) -> Retained<NSArray<UITextSelectionRect>> where Self: Sized + Message { ... } fn closestPositionToPoint( &self, point: CGPoint, ) -> Option<Retained<UITextPosition>> where Self: Sized + Message { ... } fn closestPositionToPoint_withinRange( &self, point: CGPoint, range: &UITextRange, ) -> Option<Retained<UITextPosition>> where Self: Sized + Message { ... } fn characterRangeAtPoint( &self, point: CGPoint, ) -> Option<Retained<UITextRange>> where Self: Sized + Message { ... } fn shouldChangeTextInRange_replacementText( &self, range: &UITextRange, text: &NSString, ) -> bool where Self: Sized + Message { ... } fn textStylingAtPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>> where Self: Sized + Message { ... } fn positionWithinRange_atCharacterOffset( &self, range: &UITextRange, offset: NSInteger, ) -> Option<Retained<UITextPosition>> where Self: Sized + Message { ... } fn characterOffsetOfPosition_withinRange( &self, position: &UITextPosition, range: &UITextRange, ) -> NSInteger where Self: Sized + Message { ... } fn textInputView(&self) -> Retained<UIView> where Self: Sized + Message { ... } fn selectionAffinity(&self) -> UITextStorageDirection where Self: Sized + Message { ... } fn setSelectionAffinity(&self, selection_affinity: UITextStorageDirection) where Self: Sized + Message { ... } fn insertDictationResult( &self, dictation_result: &NSArray<UIDictationPhrase>, ) where Self: Sized + Message { ... } fn dictationRecordingDidEnd(&self) where Self: Sized + Message { ... } fn dictationRecognitionFailed(&self) where Self: Sized + Message { ... } fn insertDictationResultPlaceholder(&self) -> Retained<AnyObject> where Self: Sized + Message { ... } unsafe fn frameForDictationResultPlaceholder( &self, placeholder: &AnyObject, ) -> CGRect where Self: Sized + Message { ... } unsafe fn removeDictationResultPlaceholder_willInsertResult( &self, placeholder: &AnyObject, will_insert_result: bool, ) where Self: Sized + Message { ... } fn insertText_alternatives_style( &self, text: &NSString, alternatives: &NSArray<NSString>, style: UITextAlternativeStyle, ) where Self: Sized + Message { ... } fn setAttributedMarkedText_selectedRange( &self, marked_text: Option<&NSAttributedString>, selected_range: NSRange, ) where Self: Sized + Message { ... } fn insertTextPlaceholderWithSize( &self, size: CGSize, ) -> Retained<UITextPlaceholder> where Self: Sized + Message { ... } fn removeTextPlaceholder(&self, text_placeholder: &UITextPlaceholder) where Self: Sized + Message { ... } fn beginFloatingCursorAtPoint(&self, point: CGPoint) where Self: Sized + Message { ... } fn updateFloatingCursorAtPoint(&self, point: CGPoint) where Self: Sized + Message { ... } fn endFloatingCursor(&self) where Self: Sized + Message { ... } fn caretTransformForPosition( &self, position: &UITextPosition, ) -> CGAffineTransform where Self: Sized + Message { ... } fn editMenuForTextRange_suggestedActions( &self, text_range: &UITextRange, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>> where Self: Sized + Message { ... } fn willPresentEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, ) where Self: Sized + Message { ... } fn willDismissEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, ) where Self: Sized + Message { ... } fn supportsAdaptiveImageGlyph(&self) -> bool where Self: Sized + Message { ... } fn setSupportsAdaptiveImageGlyph(&self, supports_adaptive_image_glyph: bool) where Self: Sized + Message { ... } fn insertAdaptiveImageGlyph_replacementRange( &self, adaptive_image_glyph: &NSAdaptiveImageGlyph, replacement_range: &UITextRange, ) where Self: Sized + Message { ... } fn isEditable(&self) -> bool where Self: Sized + Message { ... } fn insertAttributedText(&self, string: &NSAttributedString) where Self: Sized + Message { ... } fn attributedTextInRange( &self, range: &UITextRange, ) -> Retained<NSAttributedString> where Self: Sized + Message { ... } fn replaceRange_withAttributedText( &self, range: &UITextRange, attributed_text: &NSAttributedString, ) where Self: Sized + Message { ... } fn willPresentWritingTools(&self) where Self: Sized + Message { ... } fn didDismissWritingTools(&self) where Self: Sized + Message { ... } fn insertInputSuggestion(&self, input_suggestion: &UIInputSuggestion) where Self: Sized + Message { ... }
}
Available on crate features UITextInput and UITextInputTraits only.
Expand description

Provided Methods§

Source

fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>>
where Self: Sized + Message,

Source

fn replaceRange_withText(&self, range: &UITextRange, text: &NSString)
where Self: Sized + Message,

Source

fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
where Self: Sized + Message,

Source

fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
where Self: Sized + Message,

Setter for selectedTextRange.

This is copied when set.

Source

fn markedTextRange(&self) -> Option<Retained<UITextRange>>
where Self: Sized + Message,

Source

fn markedTextStyle( &self, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
where Self: Sized + Message,

Source

unsafe fn setMarkedTextStyle( &self, marked_text_style: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>, )
where Self: Sized + Message,

Setter for markedTextStyle.

This is copied when set.

§Safety

marked_text_style generic should be of the correct type.

Source

fn setMarkedText_selectedRange( &self, marked_text: Option<&NSString>, selected_range: NSRange, )
where Self: Sized + Message,

Source

fn unmarkText(&self)
where Self: Sized + Message,

Source

fn beginningOfDocument(&self) -> Retained<UITextPosition>
where Self: Sized + Message,

Source

fn endOfDocument(&self) -> Retained<UITextPosition>
where Self: Sized + Message,

Source

fn textRangeFromPosition_toPosition( &self, from_position: &UITextPosition, to_position: &UITextPosition, ) -> Option<Retained<UITextRange>>
where Self: Sized + Message,

Source

fn positionFromPosition_offset( &self, position: &UITextPosition, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
where Self: Sized + Message,

Source

fn positionFromPosition_inDirection_offset( &self, position: &UITextPosition, direction: UITextLayoutDirection, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
where Self: Sized + Message,

Source

fn comparePosition_toPosition( &self, position: &UITextPosition, other: &UITextPosition, ) -> NSComparisonResult
where Self: Sized + Message,

Source

fn offsetFromPosition_toPosition( &self, from: &UITextPosition, to_position: &UITextPosition, ) -> NSInteger
where Self: Sized + Message,

Source

fn inputDelegate( &self, ) -> Option<Retained<ProtocolObject<dyn UITextInputDelegate>>>
where Self: Sized + Message,

Source

fn setInputDelegate( &self, input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>>, )
where Self: Sized + Message,

Setter for inputDelegate.

This is a weak property.

Source

fn tokenizer(&self) -> Retained<ProtocolObject<dyn UITextInputTokenizer>>
where Self: Sized + Message,

Source

fn positionWithinRange_farthestInDirection( &self, range: &UITextRange, direction: UITextLayoutDirection, ) -> Option<Retained<UITextPosition>>
where Self: Sized + Message,

Source

fn characterRangeByExtendingPosition_inDirection( &self, position: &UITextPosition, direction: UITextLayoutDirection, ) -> Option<Retained<UITextRange>>
where Self: Sized + Message,

Source

fn baseWritingDirectionForPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> NSWritingDirection
where Self: Sized + Message,

Available on crate feature NSText only.
Source

fn setBaseWritingDirection_forRange( &self, writing_direction: NSWritingDirection, range: &UITextRange, )
where Self: Sized + Message,

Available on crate feature NSText only.
Source

fn firstRectForRange(&self, range: &UITextRange) -> CGRect
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn selectionRectsForRange( &self, range: &UITextRange, ) -> Retained<NSArray<UITextSelectionRect>>
where Self: Sized + Message,

Source

fn closestPositionToPoint( &self, point: CGPoint, ) -> Option<Retained<UITextPosition>>
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn closestPositionToPoint_withinRange( &self, point: CGPoint, range: &UITextRange, ) -> Option<Retained<UITextPosition>>
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn characterRangeAtPoint(&self, point: CGPoint) -> Option<Retained<UITextRange>>
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn shouldChangeTextInRange_replacementText( &self, range: &UITextRange, text: &NSString, ) -> bool
where Self: Sized + Message,

Source

fn textStylingAtPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
where Self: Sized + Message,

Source

fn positionWithinRange_atCharacterOffset( &self, range: &UITextRange, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
where Self: Sized + Message,

Source

fn characterOffsetOfPosition_withinRange( &self, position: &UITextPosition, range: &UITextRange, ) -> NSInteger
where Self: Sized + Message,

Source

fn textInputView(&self) -> Retained<UIView>
where Self: Sized + Message,

Available on crate features UIResponder and UIView only.
Source

fn selectionAffinity(&self) -> UITextStorageDirection
where Self: Sized + Message,

Source

fn setSelectionAffinity(&self, selection_affinity: UITextStorageDirection)
where Self: Sized + Message,

Setter for selectionAffinity.

Source

fn insertDictationResult(&self, dictation_result: &NSArray<UIDictationPhrase>)
where Self: Sized + Message,

Source

fn dictationRecordingDidEnd(&self)
where Self: Sized + Message,

Source

fn dictationRecognitionFailed(&self)
where Self: Sized + Message,

Source

fn insertDictationResultPlaceholder(&self) -> Retained<AnyObject>
where Self: Sized + Message,

Source

unsafe fn frameForDictationResultPlaceholder( &self, placeholder: &AnyObject, ) -> CGRect
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
§Safety

placeholder should be of the correct type.

Source

unsafe fn removeDictationResultPlaceholder_willInsertResult( &self, placeholder: &AnyObject, will_insert_result: bool, )
where Self: Sized + Message,

§Safety

placeholder should be of the correct type.

Source

fn insertText_alternatives_style( &self, text: &NSString, alternatives: &NSArray<NSString>, style: UITextAlternativeStyle, )
where Self: Sized + Message,

Source

fn setAttributedMarkedText_selectedRange( &self, marked_text: Option<&NSAttributedString>, selected_range: NSRange, )
where Self: Sized + Message,

Source

fn insertTextPlaceholderWithSize( &self, size: CGSize, ) -> Retained<UITextPlaceholder>
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn removeTextPlaceholder(&self, text_placeholder: &UITextPlaceholder)
where Self: Sized + Message,

Source

fn beginFloatingCursorAtPoint(&self, point: CGPoint)
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn updateFloatingCursorAtPoint(&self, point: CGPoint)
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.
Source

fn endFloatingCursor(&self)
where Self: Sized + Message,

Source

fn caretTransformForPosition( &self, position: &UITextPosition, ) -> CGAffineTransform
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.

Similar to -caretRectForPosition:, optionally provide a transform for the caret at position. As with all geometry information in this protocol, transforms are assumed to be relative to the textInputView coordinate space. If unimplemented, the identity transform is assumed.

Source

fn editMenuForTextRange_suggestedActions( &self, text_range: &UITextRange, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>>
where Self: Sized + Message,

Available on crate features UIMenu and UIMenuElement only.

Called when the text input is preparing an edit menu presentation for the specified text range.

Parameter textRange: The text range for which the menu is presented for.

Parameter suggestedActions: The actions and commands that the system suggests.

Returns: Return a UIMenu describing the desired menu hierarchy. Return nilto present the default system menu.

Source

fn willPresentEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

Available on crate feature UIEditMenuInteraction only.
Source

fn willDismissEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

Available on crate feature UIEditMenuInteraction only.
Source

fn supportsAdaptiveImageGlyph(&self) -> bool
where Self: Sized + Message,

Source

fn setSupportsAdaptiveImageGlyph(&self, supports_adaptive_image_glyph: bool)
where Self: Sized + Message,

Source

fn insertAdaptiveImageGlyph_replacementRange( &self, adaptive_image_glyph: &NSAdaptiveImageGlyph, replacement_range: &UITextRange, )
where Self: Sized + Message,

Available on crate feature NSAdaptiveImageGlyph only.
Source

fn isEditable(&self) -> bool
where Self: Sized + Message,

Source

fn insertAttributedText(&self, string: &NSAttributedString)
where Self: Sized + Message,

Source

fn attributedTextInRange( &self, range: &UITextRange, ) -> Retained<NSAttributedString>
where Self: Sized + Message,

Source

fn replaceRange_withAttributedText( &self, range: &UITextRange, attributed_text: &NSAttributedString, )
where Self: Sized + Message,

Source

fn willPresentWritingTools(&self)
where Self: Sized + Message,

Source

fn didDismissWritingTools(&self)
where Self: Sized + Message,

Source

fn insertInputSuggestion(&self, input_suggestion: &UIInputSuggestion)
where Self: Sized + Message,

Available on crate feature UIInputSuggestion only.

Inserts the user or system’s input suggestion into the document.

Trait Implementations§

Source§

impl ProtocolType for dyn UITextInput

Source§

const NAME: &'static str = "UITextInput"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn UITextInput
where T: ?Sized + Message + UITextInput,

Implementations on Foreign Types§

Source§

impl<T> UITextInput for ProtocolObject<T>
where T: ?Sized + UITextInput,

Implementors§

Source§

impl UITextInput for UISearchTextField

Available on crate feature UISearchTextField only.
Source§

impl UITextInput for UITextField

Available on crate feature UITextField only.
Source§

impl UITextInput for UITextView

Available on crate feature UITextView only.