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 { ... }
}UITextInput and UITextInputTraits only.Expand description
Provided Methods§
fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>>
fn replaceRange_withText(&self, range: &UITextRange, text: &NSString)
fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
Sourcefn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
Setter for selectedTextRange.
This is copied when set.
fn markedTextRange(&self) -> Option<Retained<UITextRange>>
fn markedTextStyle( &self, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
Sourceunsafe fn setMarkedTextStyle(
&self,
marked_text_style: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
)
unsafe fn setMarkedTextStyle( &self, marked_text_style: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>, )
Setter for markedTextStyle.
This is copied when set.
§Safety
marked_text_style generic should be of the correct type.
fn setMarkedText_selectedRange( &self, marked_text: Option<&NSString>, selected_range: NSRange, )
fn unmarkText(&self)
fn beginningOfDocument(&self) -> Retained<UITextPosition>
fn endOfDocument(&self) -> Retained<UITextPosition>
fn textRangeFromPosition_toPosition( &self, from_position: &UITextPosition, to_position: &UITextPosition, ) -> Option<Retained<UITextRange>>
fn positionFromPosition_offset( &self, position: &UITextPosition, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
fn positionFromPosition_inDirection_offset( &self, position: &UITextPosition, direction: UITextLayoutDirection, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
fn comparePosition_toPosition( &self, position: &UITextPosition, other: &UITextPosition, ) -> NSComparisonResult
fn offsetFromPosition_toPosition( &self, from: &UITextPosition, to_position: &UITextPosition, ) -> NSInteger
fn inputDelegate( &self, ) -> Option<Retained<ProtocolObject<dyn UITextInputDelegate>>>
Sourcefn setInputDelegate(
&self,
input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>>,
)
fn setInputDelegate( &self, input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>>, )
Setter for inputDelegate.
This is a weak property.
fn tokenizer(&self) -> Retained<ProtocolObject<dyn UITextInputTokenizer>>
fn positionWithinRange_farthestInDirection( &self, range: &UITextRange, direction: UITextLayoutDirection, ) -> Option<Retained<UITextPosition>>
fn characterRangeByExtendingPosition_inDirection( &self, position: &UITextPosition, direction: UITextLayoutDirection, ) -> Option<Retained<UITextRange>>
fn baseWritingDirectionForPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> NSWritingDirection
NSText only.fn setBaseWritingDirection_forRange( &self, writing_direction: NSWritingDirection, range: &UITextRange, )
NSText only.fn firstRectForRange(&self, range: &UITextRange) -> CGRect
objc2-core-foundation only.fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
objc2-core-foundation only.fn selectionRectsForRange( &self, range: &UITextRange, ) -> Retained<NSArray<UITextSelectionRect>>
fn closestPositionToPoint( &self, point: CGPoint, ) -> Option<Retained<UITextPosition>>
objc2-core-foundation only.fn closestPositionToPoint_withinRange( &self, point: CGPoint, range: &UITextRange, ) -> Option<Retained<UITextPosition>>
objc2-core-foundation only.fn characterRangeAtPoint(&self, point: CGPoint) -> Option<Retained<UITextRange>>
objc2-core-foundation only.fn shouldChangeTextInRange_replacementText( &self, range: &UITextRange, text: &NSString, ) -> bool
fn textStylingAtPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
fn positionWithinRange_atCharacterOffset( &self, range: &UITextRange, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
fn characterOffsetOfPosition_withinRange( &self, position: &UITextPosition, range: &UITextRange, ) -> NSInteger
fn textInputView(&self) -> Retained<UIView>
UIResponder and UIView only.fn selectionAffinity(&self) -> UITextStorageDirection
Sourcefn setSelectionAffinity(&self, selection_affinity: UITextStorageDirection)
fn setSelectionAffinity(&self, selection_affinity: UITextStorageDirection)
Setter for selectionAffinity.
fn insertDictationResult(&self, dictation_result: &NSArray<UIDictationPhrase>)
fn dictationRecordingDidEnd(&self)
fn dictationRecognitionFailed(&self)
fn insertDictationResultPlaceholder(&self) -> Retained<AnyObject>
Sourceunsafe fn frameForDictationResultPlaceholder(
&self,
placeholder: &AnyObject,
) -> CGRect
Available on crate feature objc2-core-foundation only.
unsafe fn frameForDictationResultPlaceholder( &self, placeholder: &AnyObject, ) -> CGRect
objc2-core-foundation only.§Safety
placeholder should be of the correct type.
Sourceunsafe fn removeDictationResultPlaceholder_willInsertResult(
&self,
placeholder: &AnyObject,
will_insert_result: bool,
)
unsafe fn removeDictationResultPlaceholder_willInsertResult( &self, placeholder: &AnyObject, will_insert_result: bool, )
§Safety
placeholder should be of the correct type.
fn insertText_alternatives_style( &self, text: &NSString, alternatives: &NSArray<NSString>, style: UITextAlternativeStyle, )
fn setAttributedMarkedText_selectedRange( &self, marked_text: Option<&NSAttributedString>, selected_range: NSRange, )
fn insertTextPlaceholderWithSize( &self, size: CGSize, ) -> Retained<UITextPlaceholder>
objc2-core-foundation only.fn removeTextPlaceholder(&self, text_placeholder: &UITextPlaceholder)
fn beginFloatingCursorAtPoint(&self, point: CGPoint)
objc2-core-foundation only.fn updateFloatingCursorAtPoint(&self, point: CGPoint)
objc2-core-foundation only.fn endFloatingCursor(&self)
Sourcefn caretTransformForPosition(
&self,
position: &UITextPosition,
) -> CGAffineTransform
Available on crate feature objc2-core-foundation only.
fn caretTransformForPosition( &self, position: &UITextPosition, ) -> CGAffineTransform
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.
Sourcefn editMenuForTextRange_suggestedActions(
&self,
text_range: &UITextRange,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
Available on crate features UIMenu and UIMenuElement only.
fn editMenuForTextRange_suggestedActions( &self, text_range: &UITextRange, suggested_actions: &NSArray<UIMenuElement>, ) -> Option<Retained<UIMenu>>
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.
fn willPresentEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
UIEditMenuInteraction only.fn willDismissEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
UIEditMenuInteraction only.fn supportsAdaptiveImageGlyph(&self) -> bool
Sourcefn setSupportsAdaptiveImageGlyph(&self, supports_adaptive_image_glyph: bool)
fn setSupportsAdaptiveImageGlyph(&self, supports_adaptive_image_glyph: bool)
Setter for supportsAdaptiveImageGlyph.
fn insertAdaptiveImageGlyph_replacementRange( &self, adaptive_image_glyph: &NSAdaptiveImageGlyph, replacement_range: &UITextRange, )
NSAdaptiveImageGlyph only.fn isEditable(&self) -> bool
fn insertAttributedText(&self, string: &NSAttributedString)
fn attributedTextInRange( &self, range: &UITextRange, ) -> Retained<NSAttributedString>
fn replaceRange_withAttributedText( &self, range: &UITextRange, attributed_text: &NSAttributedString, )
fn willPresentWritingTools(&self)
fn didDismissWritingTools(&self)
Sourcefn insertInputSuggestion(&self, input_suggestion: &UIInputSuggestion)
Available on crate feature UIInputSuggestion only.
fn insertInputSuggestion(&self, input_suggestion: &UIInputSuggestion)
UIInputSuggestion only.Inserts the user or system’s input suggestion into the document.
Trait Implementations§
Source§impl ProtocolType for dyn UITextInput
impl ProtocolType for dyn UITextInput
impl<T> ImplementedBy<T> for dyn UITextInput
Implementations on Foreign Types§
impl<T> UITextInput for ProtocolObject<T>where
T: ?Sized + UITextInput,
Implementors§
impl UITextInput for UISearchTextField
UISearchTextField only.impl UITextInput for UITextField
UITextField only.impl UITextInput for UITextView
UITextView only.