Trait UITextInput

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

Provided Methods§

Source

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

Source

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

Source

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

Source

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

Setter for selectedTextRange.

Source

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

Source

unsafe 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.

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

This is a weak property. Setter for inputDelegate.

Source

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

Source

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

Source

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

Source

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

Available on crate feature NSText only.
Source

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

Available on crate feature NSText only.
Source

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

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

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

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

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

Source

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

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

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

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

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

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

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

Source

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

Source

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

Source

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

Source

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

Available on crate features UIResponder and UIView only.
Source

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

Source

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

Setter for selectionAffinity.

Source

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

Source

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

Source

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

Source

unsafe 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.
Source

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

Source

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

Source

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

Source

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

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

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

Source

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

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

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

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

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

Source

unsafe 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

unsafe 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

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

Available on crate feature UIEditMenuInteraction only.
Source

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

Available on crate feature UIEditMenuInteraction only.
Source

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

Source

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

Source

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

Available on crate feature NSAdaptiveImageGlyph only.
Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

unsafe 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.