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