In my UITextField,when I type @ ,I am able to show a pop up containing an array values.
But now my client need to do some modifications.If a user type @, popup should not come,but when he type any letter after @,all the friends name starting with that letter should come in a popup.
Eg:- if user typed @p – pop up will come with all the friends name starting with letter P.
How to do this,I have tried something but could not make it happen
(I am getting friends list in an array while loading the view)
Now I am using
- (BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
if([string isEqualToString:@"@"]) {
s=1;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[frndsView setCenter:CGPointMake(frndsView.center.x, frndsView.center.y-310)];
[UIView commitAnimations];
[commentField resignFirstResponder];
}
return YES;
}
You mean Auto Complete. Check this tutorial.