Post

Replies

Boosts

Views

Activity

Reply to how to disable copy/paste in textfield ?
If you want to disable pasting for a specific TextField you can use UITextFieldDelegate. Below code is working to find a specific TextField and stop pasting. class TextClass: UITextFieldDelegate { func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { if textField == yourSpecificTextFiled{ if UIPasteboard.general.isKind(of: UIPasteboard.self){ return false } return true } } }
Mar ’24