How to make a custom keyboard using Objective-C that can type images

112 Views Asked by At

I want to make a custom keyboard that types custom emojis instead of just letters and numbers. The following code helps me type just a letter or number

[self.textDocumentProxy insertText:[key currentTitle]];

but if I change "currentTitle" to "currentImage" it does not result in the correct action because "insertText" is not expecting an UIImage. Can anybody help me with this?

1

There are 1 best solutions below

2
Davyd Geyl On

Emojis are characters that are represented by images.

[self.textDocumentProxy insertText:""];

If you know the code of the emoji:

[self.textDocumentProxy insertText:[NSString stringWithFormat:@"%C", 0xe04e]];