ASEditableTextNodeDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | ASEditableTextNode.h |
Overview
The methods declared by the ASEditableTextNodeDelegate protocol allow the adopting delegate to respond to notifications such as began and finished editing, selection changed and text updated; and manage whether a specified text should be replaced.
– editableTextNodeDidBeginEditing:
Indicates to the delegate that the text node began editing.
- (void)editableTextNodeDidBeginEditing:(ASEditableTextNode *)editableTextNode
Parameters
editableTextNode |
An editable text node. |
---|
Discussion
The invocation of this method coincides with the keyboard animating to become visible.
Declared In
ASEditableTextNode.h
– editableTextNode:shouldChangeTextInRange:replacementText:
Asks the delegate whether the specified text should be replaced in the editable text node.
- (BOOL)editableTextNode:(ASEditableTextNode *)editableTextNode shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
Parameters
editableTextNode |
An editable text node. |
---|---|
range |
The current selection range. If the length of the range is 0, range reflects the current insertion point. If the user presses the Delete key, the length of the range is 1 and an empty string object replaces that single character. |
text |
The text to insert. |
Return Value
The text node calls this method whenever the user types a new character or deletes an existing character. Implementation of this method is optional – the default implementation returns YES.
Discussion
YES if the old text should be replaced by the new text; NO if the replacement operation should be aborted.
Declared In
ASEditableTextNode.h
– editableTextNodeDidChangeSelection:fromSelectedRange:toSelectedRange:dueToEditing:
Indicates to the delegate that the text node’s selection has changed.
- (void)editableTextNodeDidChangeSelection:(ASEditableTextNode *)editableTextNode fromSelectedRange:(NSRange)fromSelectedRange toSelectedRange:(NSRange)toSelectedRange dueToEditing:(BOOL)dueToEditing
Parameters
editableTextNode |
An editable text node. |
---|---|
fromSelectedRange |
The previously selected range. |
toSelectedRange |
The current selected range. Equivalent to the |
dueToEditing |
YES if the selection change was due to editing; NO otherwise. |
Discussion
You can access the selection of the receiver via
Declared In
ASEditableTextNode.h
– editableTextNodeDidUpdateText:
Indicates to the delegate that the text node’s text was updated.
- (void)editableTextNodeDidUpdateText:(ASEditableTextNode *)editableTextNode
Parameters
editableTextNode |
An editable text node. |
---|
Discussion
This method is called each time the user updated the text node’s text. It is not called for programmatic changes made to the text via the
Declared In
ASEditableTextNode.h
– editableTextNodeDidFinishEditing:
Indicates to the delegate that teh text node has finished editing.
- (void)editableTextNodeDidFinishEditing:(ASEditableTextNode *)editableTextNode
Parameters
editableTextNode |
An editable text node. |
---|
Discussion
The invocation of this method coincides with the keyboard animating to become hidden.
Declared In
ASEditableTextNode.h