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

Answer by User18474728 for How to know when text is pasted into a UITextView?

$
0
0

It is for Swift5.1

func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {    if let paste = UIPasteboard.general.string, text == paste {       print("paste")    } else {       print("normal typing")    }    return true}

Viewing all articles
Browse latest Browse all 14

Trending Articles



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