Trait cacao::input::TextFieldDelegate
source · [−]pub trait TextFieldDelegate {
const NAME: &'static str;
fn subclass_name(&self) -> &'static str { ... }
fn did_load(&mut self, view: TextField) { ... }
fn text_did_end_editing(&self, value: &str) { ... }
fn text_should_begin_editing(&self, value: &str) -> bool { ... }
fn text_did_begin_editing(&self, value: &str) { ... }
fn text_did_change(&self, value: &str) { ... }
fn text_should_end_editing(&self, value: &str) -> bool { ... }
}
Expand description
This trait can be used for implementing custom text field behavior.
Required Associated Constants
Provided Methods
fn subclass_name(&self) -> &'static str
fn subclass_name(&self) -> &'static str
You should rarely (read: probably never) need to implement this yourself.
It simply acts as a getter for the associated NAME
const on this trait.
Called when the text field is loaded. You’re passed a reference to the underlying text field for future local use.
fn text_did_end_editing(&self, value: &str)
fn text_did_end_editing(&self, value: &str)
Posts a notification when the text is no longer in edit mode.
fn text_should_begin_editing(&self, value: &str) -> bool
fn text_should_begin_editing(&self, value: &str) -> bool
Requests permission to begin editing a text object.
fn text_did_begin_editing(&self, value: &str)
fn text_did_begin_editing(&self, value: &str)
Posts a notification to the default notification center that the text is about to go into edit mode.
fn text_did_change(&self, value: &str)
fn text_did_change(&self, value: &str)
Posts a notification when the text changes, and forwards the message to the text field’s cell if it responds.
fn text_should_end_editing(&self, value: &str) -> bool
fn text_should_end_editing(&self, value: &str) -> bool
Performs validation on the text field’s new value.