Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions YYKit/Text/YYTextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)textView:(YYTextView *)textView didTapHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect;
- (BOOL)textView:(YYTextView *)textView shouldLongPressHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange;
- (void)textView:(YYTextView *)textView didLongPressHighlight:(YYTextHighlight *)highlight inRange:(NSRange)characterRange rect:(CGRect)rect;
- (BOOL)textView:(YYTextView *)textView customHandlePastedImage:(UIImage *)image;
@end


Expand Down
5 changes: 5 additions & 0 deletions YYKit/Text/YYTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,11 @@ - (void)paste:(id)sender {
img = [UIImage imageWithData:p.imageData scale:kScreenScale];
}
if (img && img.size.width > 1 && img.size.height > 1) {
if ([self.delegate respondsToSelector:@selector(textView:customHandlePastedImage:)]) {
if ([self.delegate textView:self customHandlePastedImage:img]) {
return;
}
}
id content = img;
if ([img conformsToProtocol:@protocol(YYAnimatedImage)]) {
id<YYAnimatedImage> ani = (id)img;
Expand Down