mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-10 08:20:16 +00:00
SEP-491 prerequisite: add textViewShouldBeginEditing: to ASEditableTextNodeDelegate (#535)
* SEP-491 prerequisite: add textViewShouldBeginEditing: to ASEditableTextNodeDelegate * - added entry to CHANGELOG.md, addressed nit
This commit is contained in:
parent
ccc5786032
commit
19a9d29aa8
@ -14,6 +14,7 @@
|
||||
- Fix retain cycle between ASImageNode and PINAnimatedImage [Phil Larson](https://github.com/plarson) [#520](https://github.com/TextureGroup/Texture/pull/520)
|
||||
- Change the API for disabling logging from a compiler flag to a runtime C function ASDisableLogging(). [Adlai Holler](https://github.com/Adlai-Holler) [#528](https://github.com/TextureGroup/Texture/pull/528)
|
||||
- Table and collection views to consider content inset when calculating (default) element size range [Huy Nguyen](https://github.com/nguyenhuy) [#525](https://github.com/TextureGroup/Texture/pull/525)
|
||||
- [ASEditableTextNode] added -editableTextNodeShouldBeginEditing to ASEditableTextNodeDelegate to mirror the corresponding method from UITextViewDelegate. [Yan S.](https://github.com/yans) [#535](https://github.com/TextureGroup/Texture/pull/535)
|
||||
|
||||
##2.4
|
||||
- Fix an issue where inserting/deleting sections could lead to inconsistent supplementary element behavior. [Adlai Holler](https://github.com/Adlai-Holler)
|
||||
|
||||
@ -158,6 +158,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol ASEditableTextNodeDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/**
|
||||
@abstract Asks the delegate if editing should begin for the text node.
|
||||
@param editableTextNode An editable text node.
|
||||
@discussion YES if editing should begin; NO if editing should not begin -- the default returns YES.
|
||||
*/
|
||||
- (BOOL)editableTextNodeShouldBeginEditing:(ASEditableTextNode *)editableTextNode;
|
||||
|
||||
/**
|
||||
@abstract Indicates to the delegate that the text node began editing.
|
||||
@param editableTextNode An editable text node.
|
||||
|
||||
@ -699,6 +699,12 @@
|
||||
}
|
||||
|
||||
#pragma mark - UITextView Delegate
|
||||
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
|
||||
{
|
||||
// Delegateify.
|
||||
return [self _delegateShouldBeginEditing];
|
||||
}
|
||||
|
||||
- (void)textViewDidBeginEditing:(UITextView *)textView
|
||||
{
|
||||
// Delegateify.
|
||||
@ -793,6 +799,14 @@
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (BOOL)_delegateShouldBeginEditing
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(editableTextNodeShouldBeginEditing:)]) {
|
||||
return [_delegate editableTextNodeShouldBeginEditing:self];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)_delegateDidBeginEditing
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(editableTextNodeDidBeginEditing:)])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user