How to disable default return key on UIKeyboardTypeDefault
for UITextField
when text length
is <=4?
Can any one help me on this? Thanks in advance.
How to disable default return key on UIKeyboardTypeDefault
for UITextField
when text length
is <=4?
Can any one help me on this? Thanks in advance.
Try to implement this code Snippet:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if (textField.text.length <= 4)
{
return NO;
}
else
{
return YES;
}
}
and be sure that you have set the delegate of Textfield to self
yourTextFeild.delegate = self;
hope this works!!