Verified IOS, IOS Questions, Objective-c, Swift

How to validate or Allow Only Numeric value TextField in IOS or objective-c

How to validate or Allow Only Numeric value TextField in IOS or objective-c

In whatever UITextField you’re getting these values from, you can specify the kind of keyboard you want to appear when somebody touches inside the text field.

  • Check the maximum allowed characters.
  • Check the valid decimal number.
  • Check only numeric numbers.
  • The code is the UITextField delegate method. Before you use this snippet, you must have these properties:
  • self.maxCharacters
  • self.numeric // Only int characters.
  • self.decimalNumeric // Only numbers and “.”, “,”

Also Read : How to move UP the UIVIEW when keyboard is display or typing in UITEXTFIELD in IOS !!!

 

Objective C

 

 

SWIFT