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

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

$
0
0

This is working Perfect in

Xcode 11xSwift 5x

 func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {    if text.contains(UIPasteboard.general.string ?? "") {        return false    }    return true}

When ever the user try to Paste into text field the if condition will execute
This code will stop pasting


Viewing all articles
Browse latest Browse all 14

Trending Articles



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