JiteshW
JiteshW

Reputation: 2205

Showing custom emoticon in UITextField

Can I show custom emoticon inside UItextFiled as iPhone's keyboard emoticons are getting displayed. I checked the document but didn't found any method.

Upvotes: 0

Views: 844

Answers (1)

user1829646
user1829646

Reputation:

You can Use The Following Code from the Link

- (BOOL) textField: (UITextField *)theTextField shouldChangeCharactersInRange: (NSRange)range replacementString: (NSString *)string {   

NSRange range = {NSNotFound, 0};
NSString *s = @"This is a smiley :)";

range.location = 0;
range.length = [s length];
s = [s stringByReplacingOccurrencesOfString:@":)"
                                    withString:@"\ue415"
                                    options:NSCaseInsensitiveSearch
                                    range:range];

  }

Upvotes: 1

Related Questions