I have a text box and I want the user to enter only numbers. I implemented a numeric keypad there. However, if Someone put my app in the background and copy some string from other app and return to my app and paste it, it will successfully paste the string content into my digital text field. How can I restrict This situation?
@theChrisKent is very close, but there is a better way. Use the delegate method -textView: shouldChangeTextInRange: replacementText:. Check whether the replacementText contains any non-digits, if it is, then Return NO.