I am trying to add emoji in UITextField
with existing text.But I get only unicode in the textfield in place of emoji like \ue415
. I have try the below code to set emoji in the textfield.
I have a view in which there are buttons with images of emojis. on the click of that emoji i am appending the respective unicode of that emoji to the text. but in that unicode is appended in string format and not the actual symbol.
If I try to set direct unicode in the textfield then it show the emoji but if i try to get the value from array then it is not showing the emoji.
NSString *strCode = [[arrPlist objectAtIndex:[sender tag]]objectForKey:@"UTFCode"];
strCode = [strCode stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *mycode = @"\ue415";
if ([mycode isEqualToString:strCode])
{
NSLog(@"both are same");
}
NSLog(@"%@",[NSString stringWithFormat:@"strCode:%@ and mycode:%@",strCode,mycode]);
messageField.text = [messageField.text stringByAppendingFormat:@"%@ %@",strCode,mycode];
And the output is like :
strCode:\ue415 and mycode:
Can anyone help me with how can i get the strCode same as myCode ?