Quantcast
Channel: How to know when text is pasted into a UITextView? - Stack Overflow
Viewing all articles
Browse latest Browse all 13

Answer by Joseph Razon IL for How to know when text is pasted into a UITextView?

$
0
0

This is what I use to detect pasted images:

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{    if (UIPasteboard.generalPasteboard.image &&        [UIPasteboard.generalPasteboard.string.lowercaseString isEqualToString:text.lowercaseString]) {       //Pasted image        return NO;    }    return YES;}

Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>