pub unsafe trait UITextInput: UIKeyInput + MainThreadOnly {
Show 62 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 { ... }
}UITextInput and UITextInputTraits only.Expand description
Provided Methods§
unsafe fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>>
unsafe fn replaceRange_withText(&self, range: &UITextRange, text: &NSString)
unsafe fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
Sourceunsafe fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
unsafe fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
Setter for selectedTextRange.
unsafe fn markedTextRange(&self) -> Option<Retained<UITextRange>>
unsafe 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.
unsafe fn setMarkedText_selectedRange( &self, marked_text: Option<&NSString>, selected_range: NSRange, )
unsafe fn unmarkText(&self)
unsafe fn beginningOfDocument(&self) -> Retained<UITextPosition>
unsafe fn endOfDocument(&self) -> Retained<UITextPosition>
unsafe fn textRangeFromPosition_toPosition( &self, from_position: &UITextPosition, to_position: &UITextPosition, ) -> Option<Retained<UITextRange>>
unsafe fn positionFromPosition_offset( &self, position: &UITextPosition, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
unsafe fn positionFromPosition_inDirection_offset( &self, position: &UITextPosition, direction: UITextLayoutDirection, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
unsafe fn comparePosition_toPosition( &self, position: &UITextPosition, other: &UITextPosition, ) -> NSComparisonResult
unsafe fn offsetFromPosition_toPosition( &self, from: &UITextPosition, to_position: &UITextPosition, ) -> NSInteger
unsafe fn inputDelegate( &self, ) -> Option<Retained<ProtocolObject<dyn UITextInputDelegate>>>
Sourceunsafe fn setInputDelegate(
&self,
input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>>,
)
unsafe fn setInputDelegate( &self, input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>>, )
This is a weak property.
Setter for inputDelegate.
unsafe fn tokenizer(&self) -> Retained<ProtocolObject<dyn UITextInputTokenizer>>
unsafe fn positionWithinRange_farthestInDirection( &self, range: &UITextRange, direction: UITextLayoutDirection, ) -> Option<Retained<UITextPosition>>
unsafe fn characterRangeByExtendingPosition_inDirection( &self, position: &UITextPosition, direction: UITextLayoutDirection, ) -> Option<Retained<UITextRange>>
unsafe fn baseWritingDirectionForPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> NSWritingDirection
NSText only.unsafe fn setBaseWritingDirection_forRange( &self, writing_direction: NSWritingDirection, range: &UITextRange, )
NSText only.unsafe fn firstRectForRange(&self, range: &UITextRange) -> CGRect
objc2-core-foundation only.unsafe fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
objc2-core-foundation only.unsafe fn selectionRectsForRange( &self, range: &UITextRange, ) -> Retained<NSArray<UITextSelectionRect>>
unsafe fn closestPositionToPoint( &self, point: CGPoint, ) -> Option<Retained<UITextPosition>>
objc2-core-foundation only.unsafe fn closestPositionToPoint_withinRange( &self, point: CGPoint, range: &UITextRange, ) -> Option<Retained<UITextPosition>>
objc2-core-foundation only.unsafe fn characterRangeAtPoint( &self, point: CGPoint, ) -> Option<Retained<UITextRange>>
objc2-core-foundation only.unsafe fn shouldChangeTextInRange_replacementText( &self, range: &UITextRange, text: &NSString, ) -> bool
unsafe fn textStylingAtPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
unsafe fn positionWithinRange_atCharacterOffset( &self, range: &UITextRange, offset: NSInteger, ) -> Option<Retained<UITextPosition>>
unsafe fn characterOffsetOfPosition_withinRange( &self, position: &UITextPosition, range: &UITextRange, ) -> NSInteger
unsafe fn textInputView(&self) -> Retained<UIView>
UIResponder and UIView only.unsafe fn selectionAffinity(&self) -> UITextStorageDirection
Sourceunsafe fn setSelectionAffinity(
&self,
selection_affinity: UITextStorageDirection,
)
unsafe fn setSelectionAffinity( &self, selection_affinity: UITextStorageDirection, )
Setter for selectionAffinity.
unsafe fn insertDictationResult( &self, dictation_result: &NSArray<UIDictationPhrase>, )
unsafe fn dictationRecordingDidEnd(&self)
unsafe fn dictationRecognitionFailed(&self)
unsafe fn insertDictationResultPlaceholder(&self) -> Retained<AnyObject>
unsafe fn frameForDictationResultPlaceholder( &self, placeholder: &AnyObject, ) -> CGRect
objc2-core-foundation only.unsafe fn removeDictationResultPlaceholder_willInsertResult( &self, placeholder: &AnyObject, will_insert_result: bool, )
unsafe fn insertText_alternatives_style( &self, text: &NSString, alternatives: &NSArray<NSString>, style: UITextAlternativeStyle, )
unsafe fn setAttributedMarkedText_selectedRange( &self, marked_text: Option<&NSAttributedString>, selected_range: NSRange, )
unsafe fn insertTextPlaceholderWithSize( &self, size: CGSize, ) -> Retained<UITextPlaceholder>
objc2-core-foundation only.unsafe fn removeTextPlaceholder(&self, text_placeholder: &UITextPlaceholder)
unsafe fn beginFloatingCursorAtPoint(&self, point: CGPoint)
objc2-core-foundation only.unsafe fn updateFloatingCursorAtPoint(&self, point: CGPoint)
objc2-core-foundation only.unsafe fn endFloatingCursor(&self)
Sourceunsafe fn caretTransformForPosition(
&self,
position: &UITextPosition,
) -> CGAffineTransform
Available on crate feature objc2-core-foundation only.
unsafe 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.
Sourceunsafe fn editMenuForTextRange_suggestedActions(
&self,
text_range: &UITextRange,
suggested_actions: &NSArray<UIMenuElement>,
) -> Option<Retained<UIMenu>>
Available on crate features UIMenu and UIMenuElement only.
unsafe 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.
unsafe fn willPresentEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
UIEditMenuInteraction only.unsafe fn willDismissEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
UIEditMenuInteraction only.unsafe fn supportsAdaptiveImageGlyph(&self) -> bool
Sourceunsafe fn setSupportsAdaptiveImageGlyph(
&self,
supports_adaptive_image_glyph: bool,
)
unsafe fn setSupportsAdaptiveImageGlyph( &self, supports_adaptive_image_glyph: bool, )
Setter for supportsAdaptiveImageGlyph.
unsafe fn insertAdaptiveImageGlyph_replacementRange( &self, adaptive_image_glyph: &NSAdaptiveImageGlyph, replacement_range: &UITextRange, )
NSAdaptiveImageGlyph only.unsafe fn isEditable(&self) -> bool
unsafe fn insertAttributedText(&self, string: &NSAttributedString)
unsafe fn attributedTextInRange( &self, range: &UITextRange, ) -> Retained<NSAttributedString>
unsafe fn replaceRange_withAttributedText( &self, range: &UITextRange, attributed_text: &NSAttributedString, )
unsafe fn willPresentWritingTools(&self)
unsafe fn didDismissWritingTools(&self)
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
UIControl and UIResponder and UITextField and UIView and UISearchTextField only.impl UITextInput for UITextField
UIControl and UIResponder and UIView and UITextField only.impl UITextInput for UITextView
UIResponder and UIScrollView and UIView and UITextView only.